aboutsummaryrefslogtreecommitdiff
path: root/src/lib/server/services/grocery-actions.ts
Commit message (Collapse)AuthorAge
* refactor: inject the database into every servicemainMartin Kagamino Lehoux15 hours
| | | | | | | 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.
* refactor: inject the database into services via a constructorMartin Kagamino Lehoux15 hours
| | | | | | | 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.
* fix: report a duplicate name instead of failing the pageMartin Kagamino Lehoux15 hours
| | | | | | Adding a category or project whose name exists, or renaming an item onto an existing name, hit the unique constraint and rendered SvelteKit's 500 page. Translate SQLITE_CONSTRAINT_UNIQUE into a form error on the three forms.
* feat: promote a reference as the primary shown in listsMartin Kagamino Lehoux12 days
| | | | Add an is_primary flag to references; the promoted ref sorts first on the item page and is the one shown under the item in the list and catalog. Item page gets a star toggle per reference.
* Compress comments to terse single lines within line widthMartin Kagamino Lehoux2026-09-25
|
* Share grocery row component and list-page form actionsMartin Kagamino Lehoux2026-09-08
| | | | | | | | - GroceryRow.svelte renders the toggle row (checkbox, name, best ref, arrow link) for both the list and catalog pages - grocery-actions.ts grows full form actions: addCategoryAction, addGroceryAction, addGroceryAndEditAction, deleteByIdAction; the categories/groceries route servers become thin wrappers
* Extract shared groceries helpers and BestRef componentMartin Kagamino Lehoux2026-09-07