refactor: ♻️ simplify db mock

This commit is contained in:
Julien Oculi 2024-06-19 17:14:34 +02:00
parent 889cf1b34a
commit 23ecb8de39

View file

@ -10,9 +10,8 @@ import { existsSync } from '$std/fs/exists.ts'
const dbPath = './_fresh/db.sqlite'
export const db = await Db.init(dbPath)
//! Temp for demo only
if (!sessionStorage.getItem('db-loaded') && !existsSync(dbPath)) {
if (!existsSync(dbPath)) {
console.log('=============LOAD DB=============')
// Load groups to DB
@ -37,6 +36,4 @@ if (!sessionStorage.getItem('db-loaded') && !existsSync(dbPath)) {
db.ressource.user.set([user])
}
sessionStorage.setItem('db-loaded', 'true')
}