From b6ce09268a04cad6b18d30fea690c04b52c49811 Mon Sep 17 00:00:00 2001 From: rishikanthc Date: Fri, 18 Oct 2024 19:24:04 -0700 Subject: [PATCH] fix(bug): create db on init before checking for wizard --- src/hooks.server.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hooks.server.ts b/src/hooks.server.ts index aacaaa2..bf2f110 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -3,6 +3,7 @@ import { env } from '$env/dynamic/private'; import type { Handle } from '@sveltejs/kit'; import { sequence } from '@sveltejs/kit/hooks'; import { redirect } from '@sveltejs/kit'; +import { ensureCollectionExists } from '$lib/fileFuncs'; import '$lib/queue'; import { resolve } from 'chart.js/helpers'; @@ -54,6 +55,7 @@ export const authentication: Handle = async ({ event, resolve }) => { }; export const configuration: Handle = async ({event, resolve}) => { + ensureCollectionExists(event.locals.pb); const settings = await event.locals.pb.collection('settings').getList(1,1); console.log(settings)