Jelajahi Sumber

Bug fix: circular reference checking was not including the ingredient updates first.

Lee Morgan 5 tahun lalu
induk
melakukan
a2a188025a
1 mengubah file dengan 1 tambahan dan 3 penghapusan
  1. 1 3
      controllers/ingredientData.js

+ 1 - 3
controllers/ingredientData.js

@@ -77,9 +77,7 @@ module.exports = {
 
         Promise.all([Ingredient.findOne({_id: req.body.id}), popMerchant])
             .then((response)=>{
-                response[0].name = req.body.name;
-                response[0].category = req.body.category;
-                response[0].ingredients = [];
+                response[0].ingredients = req.body.ingredients;
 
                 // Check ingredients for circular references
                 let isCircular = (ingredient, original)=>{