Browse Source

Fix bug in removing ingredients

Lee Morgan 6 năm trước cách đây
mục cha
commit
3fbc9794df
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      views/dashboardPage/components/components.js

+ 2 - 1
views/dashboardPage/components/components.js

@@ -685,7 +685,8 @@ let ingredientDetailsComp = {
     remove: function(){
         for(let i = 0; i < merchant.recipes.length; i++){
             for(let j = 0; j < merchant.recipes[i].ingredients.length; j++){
-                if(this.ingredient.id === merchant.recipes[i].ingredients[j].ingredient._id){
+                if(this.ingredient.ingredient === merchant.recipes[i].ingredients[j].ingredient){
+                    console.log("something");
                     banner.createError("Must remove ingredient from all recipes before removing");
                     return;
                 }