feat(settings): 扩展 SettingsData 加 compact 字段,后端解析与校验
This commit is contained in:
@@ -32,6 +32,10 @@ export async function handleUpdateSettings(
|
||||
return jsonResponse(createApiError("theme 仅支持 dark、light、system", 400), { mode, status: 400 });
|
||||
}
|
||||
|
||||
if (body.compact !== undefined && typeof body.compact !== "boolean") {
|
||||
return jsonResponse(createApiError("compact 必须为布尔值", 400), { mode, status: 400 });
|
||||
}
|
||||
|
||||
const result = updateSettings(db, body, logger);
|
||||
logger.info({ data: result }, "设置已更新");
|
||||
return jsonResponse(result, { mode });
|
||||
|
||||
Reference in New Issue
Block a user