Przeglądaj źródła

Fix bug where frontend did not update on creation of new ingredient.

Lee Morgan 5 lat temu
rodzic
commit
f5dd8ac129

+ 2 - 2
views/dashboardPage/bundle.js

@@ -1980,13 +1980,13 @@ let newIngredient = {
                     )
 
                     merchant.addIngredient(ingredient, response.quantity);
-                    ingredients.display();
-                    controller.closeSidebar();
+                    controller.openStrand("ingredients");
 
                     banner.createNotification("INGREDIENT CREATED");
                 }
             })
             .catch((err)=>{
+                console.log(err);
                 banner.createError("SOMETHING WENT WRONG. PLEASE REFRESH THE PAGE");
             })
             .finally(()=>{

+ 2 - 2
views/dashboardPage/js/sidebars/newIngredient.js

@@ -75,13 +75,13 @@ let newIngredient = {
                     )
 
                     merchant.addIngredient(ingredient, response.quantity);
-                    ingredients.display();
-                    controller.closeSidebar();
+                    controller.openStrand("ingredients");
 
                     banner.createNotification("INGREDIENT CREATED");
                 }
             })
             .catch((err)=>{
+                console.log(err);
                 banner.createError("SOMETHING WENT WRONG. PLEASE REFRESH THE PAGE");
             })
             .finally(()=>{