diff --git a/src/db/mod.ts b/src/db/mod.ts index bf6ae7b..eaf87c9 100644 --- a/src/db/mod.ts +++ b/src/db/mod.ts @@ -5,13 +5,15 @@ import groups from './mock/groups.json' with { type: 'json' } import users from './mock/users.json' with { type: 'json' } import { User } from '@cohabit/ressources_manager/src/models/mod.ts' import { MailAddress } from '@cohabit/ressources_manager/types.ts' -import { existsSync } from '$std/fs/exists.ts' +import { exists } from '$std/fs/exists.ts' const dbPath = './_fresh/db.sqlite' +const dbExist = await exists(dbPath) + export const db = await Db.init(dbPath) //! Temp for demo only -if (!existsSync(dbPath)) { +if (!dbExist) { console.log('=============LOAD DB=============') // Load groups to DB