From f23aab4b3f2c5dbfdd1c4e7131fec4555d1a93a8 Mon Sep 17 00:00:00 2001 From: Anika Raemer Date: Sun, 7 Sep 2025 20:57:13 +0200 Subject: [PATCH] validate ingredient groups as well as ingredient lists of all groups --- .../src/components/IngredientListEditor.tsx | 1 + frontend/src/components/RecipeEditor.tsx | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/IngredientListEditor.tsx b/frontend/src/components/IngredientListEditor.tsx index d0d4189..bbc2750 100644 --- a/frontend/src/components/IngredientListEditor.tsx +++ b/frontend/src/components/IngredientListEditor.tsx @@ -27,6 +27,7 @@ export function IngredientListEditor({ ingredients, onChange }: IngredientListEd return (
+

Ingredients

{ingredients.map((ing, index) => (
{ + return !ingGrp.ingredientList || ingGrp.ingredientList.length === 0 + } + ) + console.log(isAnyIngredientListEmpty) + if(isAnyIngredientListEmpty){ + newErrors.ingredients = true + } } setErrors(newErrors)