Ver Fonte

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

Lee Morgan há 5 anos atrás
pai
commit
a2a188025a
1 ficheiros alterados com 1 adições e 3 exclusões
  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)=>{