diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-10-18 22:22:55 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-10-18 22:22:55 +0200 |
| commit | 4efed80a2f8dc238b420eadf97d56c3eccaadb76 (patch) | |
| tree | 7732a80745622c097a9e75dfb056603bceb10a23 /src/routes/groceries/+page.server.ts | |
| parent | 0685e9ece66fbcb09c9457027cf7bb2107cc0171 (diff) | |
refactor: inject the database into every servicemain
Groceries, projects, references and routines become classes holding the
Drizzle handle, wired once in services/index.ts alongside categories. Tests
build their own instance on an in-memory database. Drops the unused
projects.loadAll and projects.rename.
Diffstat (limited to 'src/routes/groceries/+page.server.ts')
| -rw-r--r-- | src/routes/groceries/+page.server.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/routes/groceries/+page.server.ts b/src/routes/groceries/+page.server.ts index 1cae275..d33c6a5 100644 --- a/src/routes/groceries/+page.server.ts +++ b/src/routes/groceries/+page.server.ts @@ -1,4 +1,4 @@ -import { loadUnchecked, loadAll } from '$lib/server/services/groceries'; +import { groceriesService } from '$lib/server/services'; import { addGroceryAction, addGroceryAndEditAction, @@ -15,8 +15,8 @@ export interface GroceriesOutput { } export const load: PageServerLoad = async () => { - const unchecked = await loadUnchecked(); - const all = await loadAll(); + const unchecked = await groceriesService.loadUnchecked(); + const all = await groceriesService.loadAll(); return { items: unchecked.items, categories: unchecked.categories, |
