fix missing difficulty on summary selection
This commit is contained in:
@@ -60,7 +60,7 @@ async function aggregateIngredients(selectedRecipes) {
|
|||||||
router.get('/', authenticateToken, async (req, res) => {
|
router.get('/', authenticateToken, async (req, res) => {
|
||||||
try {
|
try {
|
||||||
let userSelection = await UserSelection.findOne({ userId: req.userId })
|
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) {
|
if (!userSelection) {
|
||||||
userSelection = new UserSelection({
|
userSelection = new UserSelection({
|
||||||
|
|||||||
@@ -113,8 +113,8 @@ const ShoppingList: React.FC<ShoppingListProps> = ({ userSelection, onSelectionU
|
|||||||
<h4>{selection.recipeId.title}</h4>
|
<h4>{selection.recipeId.title}</h4>
|
||||||
<p>{selection.recipeId.description}</p>
|
<p>{selection.recipeId.description}</p>
|
||||||
<span className="recipe-meta">
|
<span className="recipe-meta">
|
||||||
{selection.recipeId.category} • {selection.recipeId.difficulty} •
|
{selection.recipeId.category || 'Uncategorized'} • {selection.recipeId.difficulty || 'Unknown'} •
|
||||||
{selection.recipeId.prepTime + selection.recipeId.cookTime} min
|
{(selection.recipeId.prepTime || 0) + (selection.recipeId.cookTime || 0)} min
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user