diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-10-18 22:02:02 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-10-18 22:02:02 +0200 |
| commit | 0685e9ece66fbcb09c9457027cf7bb2107cc0171 (patch) | |
| tree | f6dabadf2dcf55f2847a48ada2e03e491f017dcc /src/lib/server/services/projects.ts | |
| parent | c3c61894d2b119ae424bac605d4b3099e0b674e5 (diff) | |
refactor: inject the database into services via a constructor
Pilot on the categories service: a CategoriesService class holds the Drizzle
handle, and services/index.ts wires the real instance once for the server while
tests build their own on an in-memory database. AppDatabase moves from
groceries.ts to db/types.ts.
Diffstat (limited to 'src/lib/server/services/projects.ts')
| -rw-r--r-- | src/lib/server/services/projects.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/server/services/projects.ts b/src/lib/server/services/projects.ts index b58c2f1..443297b 100644 --- a/src/lib/server/services/projects.ts +++ b/src/lib/server/services/projects.ts @@ -1,7 +1,7 @@ import { db as defaultDb } from '$lib/server/db'; import { projects } from '$lib/server/db/schema'; import { asc, eq } from 'drizzle-orm'; -import type { AppDatabase } from './groceries'; +import type { AppDatabase } from '$lib/server/db/types'; import type { Project } from './types'; export async function loadAll(db = defaultDb): Promise<Project[]> { |
