Fix config API to return data directly instead of wrapped in config object
This commit is contained in:
@@ -42,15 +42,8 @@ export default defineEventHandler(async (event) => {
|
||||
|
||||
const body = await readBody(event)
|
||||
|
||||
if (!body.config) {
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
message: 'Konfigurationsdaten fehlen.'
|
||||
})
|
||||
}
|
||||
|
||||
const configFile = getDataPath('config.json')
|
||||
await fs.writeFile(configFile, JSON.stringify(body.config, null, 2), 'utf-8')
|
||||
await fs.writeFile(configFile, JSON.stringify(body, null, 2), 'utf-8')
|
||||
|
||||
return {
|
||||
success: true,
|
||||
|
||||
Reference in New Issue
Block a user