From 1b35c90dcbaa2def61fb7e032073c7857277b32a Mon Sep 17 00:00:00 2001 From: Foohoo Date: Sun, 10 Aug 2025 14:50:28 +0100 Subject: [PATCH] fix missing difficulty on summary selection --- backend/routes/selections.js | 2 +- frontend/src/components/ShoppingList.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/routes/selections.js b/backend/routes/selections.js index 4eab12b..ea8a974 100644 --- a/backend/routes/selections.js +++ b/backend/routes/selections.js @@ -60,7 +60,7 @@ async function aggregateIngredients(selectedRecipes) { router.get('/', authenticateToken, async (req, res) => { try { let userSelection = await UserSelection.findOne({ userId: req.userId }) - .populate('selectedRecipes.recipeId', 'title description imageUrl category'); + .populate('selectedRecipes.recipeId', 'title description imageUrl category difficulty prepTime cookTime'); if (!userSelection) { userSelection = new UserSelection({ diff --git a/frontend/src/components/ShoppingList.tsx b/frontend/src/components/ShoppingList.tsx index d78c15f..2257c62 100644 --- a/frontend/src/components/ShoppingList.tsx +++ b/frontend/src/components/ShoppingList.tsx @@ -113,8 +113,8 @@ const ShoppingList: React.FC = ({ userSelection, onSelectionU

{selection.recipeId.title}

{selection.recipeId.description}

- {selection.recipeId.category} • {selection.recipeId.difficulty} • - {selection.recipeId.prepTime + selection.recipeId.cookTime} min + {selection.recipeId.category || 'Uncategorized'} • {selection.recipeId.difficulty || 'Unknown'} • + {(selection.recipeId.prepTime || 0) + (selection.recipeId.cookTime || 0)} min