fix(system-settings): resolve index.post.ts L844 syntax error Expected ')' but found 'if' - fillDefaults arrow return/object literal close brackets order
This commit is contained in:
@@ -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) {
|
||||
// 如果不存在,创建新设置
|
||||
|
||||
Reference in New Issue
Block a user