From 5183217669f0375dcf3e304260debade66ea8098 Mon Sep 17 00:00:00 2001 From: jableader Date: Sun, 2 Nov 2025 00:18:45 +1100 Subject: [PATCH] =?UTF-8?q?feat(shopping):=20add=20ad=E2=80=91hoc=20items?= =?UTF-8?q?=20UI=20with=20typed=20endpoints;=20remove=20legacy=20JS=20test?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/sdk.ts | 9 ++ .../ingredients/EditableIngredientsPanel.vue | 29 +++--- src/components/shopping/MyShoppingPage.vue | 93 ++++++++++++++++--- src/composables/useShopping.ts | 1 + tests/mealMapper.test.js | 27 ------ tests/meals.api.errors.test.js | 14 --- tests/meals.api.test.js | 47 ---------- tests/parse.api.errors.test.js | 16 ---- tests/parse.api.test.js | 21 ----- tests/recipes.api.errors.test.js | 12 --- tests/recipes.api.test.js | 24 ----- tests/shopping.api.errors.test.js | 12 --- tests/shopping.api.test.js | 50 ---------- tests/shoppingListMapper.test.js | 39 -------- 14 files changed, 108 insertions(+), 286 deletions(-) delete mode 100644 tests/mealMapper.test.js delete mode 100644 tests/meals.api.errors.test.js delete mode 100644 tests/meals.api.test.js delete mode 100644 tests/parse.api.errors.test.js delete mode 100644 tests/parse.api.test.js delete mode 100644 tests/recipes.api.errors.test.js delete mode 100644 tests/recipes.api.test.js delete mode 100644 tests/shopping.api.errors.test.js delete mode 100644 tests/shopping.api.test.js delete mode 100644 tests/shoppingListMapper.test.js diff --git a/src/api/sdk.ts b/src/api/sdk.ts index 3baba8f..96629fc 100644 --- a/src/api/sdk.ts +++ b/src/api/sdk.ts @@ -385,5 +385,14 @@ export async function requestIngredient(ingredientId: number): Promise { + const householdSlug = requireSlug() + const { error, response } = await api.DELETE('/api/v1/households/{householdSlug}/shopping/current/ingredients', { + params: { path: { householdSlug } }, + body: { ingredientId }, + }) + if (!response.ok) throw httpError(response, error) +} + // Re-export domain command types for convenience at SDK surface export type { PurchaseRequest } from '@/domain/commands' diff --git a/src/components/ingredients/EditableIngredientsPanel.vue b/src/components/ingredients/EditableIngredientsPanel.vue index c571d93..1af3050 100644 --- a/src/components/ingredients/EditableIngredientsPanel.vue +++ b/src/components/ingredients/EditableIngredientsPanel.vue @@ -32,7 +32,7 @@