From 1822a62e14c0378ef816f0e31251a449f35f9e0e Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Mon, 13 Jan 2025 17:24:07 +0100 Subject: [PATCH] allow ingredient delete during import --- vue3/src/pages/RecipeImportPage.vue | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/vue3/src/pages/RecipeImportPage.vue b/vue3/src/pages/RecipeImportPage.vue index e39e75663..a8ab3304e 100644 --- a/vue3/src/pages/RecipeImportPage.vue +++ b/vue3/src/pages/RecipeImportPage.vue @@ -103,8 +103,8 @@ #{{ i + 1 }} - - + + {{ $t('Delete') }} @@ -120,8 +120,14 @@ {{ i.amount }} {{ i.unit.name }} {{ i.food.name }} @@ -359,6 +365,15 @@ function mergeStep(step: SourceImportStep) { } +/** + * deletes the given ingredient from the given step + * @param step step to delete ingredient from + * @param ingredient ingredient to delete + */ +function deleteIngredient(step: SourceImportStep, ingredient: SourceImportIngredient) { + step.ingredients = step.ingredients.filter(i => i != ingredient) +} + /** * automatically assign ingredients to steps based on text matching */