فهرست منبع

Bug fix: submitting inventory check card was duplicating ingredients on the frontend.

Lee Morgan 5 سال پیش
والد
کامیت
b41e0f3cc2
2فایلهای تغییر یافته به همراه2 افزوده شده و 3 حذف شده
  1. 0 2
      views/dashboardPage/js/dashboard.js
  2. 2 1
      views/dashboardPage/js/strands/home.js

+ 0 - 2
views/dashboardPage/js/dashboard.js

@@ -402,14 +402,12 @@ controller = {
 window.state = {
     updateIngredients: function(){
         ingredients.populateByProperty();
-        // analytics.populateButtons();
         analytics.isPopulated = false;
         home.drawInventoryCheckCard();
     },
 
     updateRecipes: function(){
         recipeBook.populateRecipes();
-        // analytics.populateButtons();
         analytics.isPopulated = false;
     },
 

+ 2 - 1
views/dashboardPage/js/strands/home.js

@@ -264,8 +264,9 @@ let home = {
                     }else{
                         for(let i = 0; i < response.length; i++){
                             merchant.removeIngredient(merchant.getIngredient(response[i].ingredient._id));
-                            merchant.addIngredients(response);
                         }
+
+                        merchant.addIngredients(response);
                         state.updateIngredients();
                         controller.createBanner("INGREDIENTS UPDATED", "success");
                     }