We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05cb0ea commit e38a7a5Copy full SHA for e38a7a5
server/api/settings.ts
@@ -2,6 +2,14 @@ import type { CompleteConfig } from '~/types'
2
3
export default defineEventHandler(async () => {
4
const storage = useStorage('main')
5
+ const config = await storage.getItem<CompleteConfig>('config')
6
- return await storage.getItem<CompleteConfig>('config')
7
+ if (!config) {
8
+ throw createError({
9
+ statusCode: 500,
10
+ statusMessage: 'Bad loading config',
11
+ })
12
+ }
13
+
14
+ return extractSafelyConfig(config)
15
})
0 commit comments