From 22a6ffc4fbe76c6b4db677a79d9c6c6c5146b22a Mon Sep 17 00:00:00 2001 From: Julien Oculi Date: Wed, 19 Jun 2024 17:27:11 +0200 Subject: [PATCH] fix: :bug: fix db mock load --- src/db/mod.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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