Skip to content

Commit efbb3be

Browse files
authored
Merge pull request #182 from Hello-Kitchen:170-return-price-of-ingredients
Return price of ingredient
2 parents 7079d88 + 375c9ce commit efbb3be

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/modules/food/food.service.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,17 @@ export class FoodService extends DB {
106106
in: {
107107
id_ingredient: '$$ingredient.id_ingredient',
108108
quantity: '$$ingredient.quantity',
109+
suppPrice: {
110+
$arrayElemAt: [
111+
'$ingredients.price',
112+
'$$ingredient.id_ingredient',
113+
],
114+
},
109115
name: {
110116
$arrayElemAt: [
111117
'$ingredients.name',
112118
'$$ingredient.id_ingredient',
113-
], // Assuming 'ingredients' is the array of ingredients
119+
],
114120
},
115121
},
116122
},

0 commit comments

Comments
 (0)