Explorar o código

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

Lee Morgan %!s(int64=5) %!d(string=hai) anos
pai
achega
a2a188025a
Modificáronse 1 ficheiros con 1 adicións e 3 borrados
  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)=>{