Explorar o código

Fix bug in removing ingredients

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