diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-10-07 19:17:14 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-10-07 19:17:14 +0200 |
| commit | 66939bab93cdcb9b7732c45d7bc3b99b6951fe15 (patch) | |
| tree | ec6bc1631464410f8735da49e02e99abff0f3863 /src/routes/groceries | |
| parent | 6e5dcdb53cea4c3f082d01c937fe5fc1d580c45b (diff) | |
feat: promote a reference as the primary shown in lists
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.
Diffstat (limited to 'src/routes/groceries')
| -rw-r--r-- | src/routes/groceries/categories/+page.server.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/routes/groceries/categories/+page.server.ts b/src/routes/groceries/categories/+page.server.ts index d02b328..6e0e3b7 100644 --- a/src/routes/groceries/categories/+page.server.ts +++ b/src/routes/groceries/categories/+page.server.ts @@ -6,7 +6,7 @@ import { } from '$lib/server/services/categories'; import { addCategoryAction, - deleteByIdAction, + idAction, } from '$lib/server/services/grocery-actions'; import { numericId } from '$lib/server/services/validation'; import type { Category } from '$lib/server/services/types'; @@ -23,7 +23,7 @@ export const load: PageServerLoad = async () => { export const actions: Actions = { add: ({ request }) => addCategoryAction(request), - delete: ({ request }) => deleteByIdAction(request, deleteCategory), + delete: ({ request }) => idAction(request, deleteCategory), reorder: async ({ request }) => { const data = await request.formData(); |
