Przeglądaj źródła

Fix bug in removing ingredients

Lee Morgan 6 lat temu
rodzic
commit
3fbc9794df
1 zmienionych plików z 2 dodań i 1 usunięć
  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;
                 }