fix(system-settings): resolve index.post.ts L844 syntax error Expected ')' but found 'if' - fillDefaults arrow return/object literal close brackets order
构建并部署 BYW VoiceHub / Preflight 语法与构建检查 (push) Failing after 1m33s
构建并部署 BYW VoiceHub / 构建并推送容器镜像 (push) Skipped
构建并部署 BYW VoiceHub / 部署到生产服务器 (push) Failing after 4s

This commit is contained in:
2026-09-11 23:01:56 +08:00
parent 5c44fca146
commit 285dd24463
@@ -841,7 +841,7 @@ export default defineEventHandler(async (event) => {
const settingsResult = await db.select().from(systemSettings).limit(1)
let settings = settingsResult[0] || null
const fillDefaults = (obj: any) => ({ ...obj, ...Object.fromEntries(Object.entries(DEFAULTS).filter(([k]) => !Object.prototype.hasOwnProperty.call(obj || {}, k) || (obj && obj[k] === undefined || obj[k] === null))) }
const fillDefaults = (obj: any) => ({ ...obj, ...Object.fromEntries(Object.entries(DEFAULTS).filter(([k]) => !Object.prototype.hasOwnProperty.call(obj || {}, k) || (obj && obj[k] === undefined || obj[k] === null)))) })
if (!settings) {
// 如果不存在,创建新设置