Explorar el Código

Update state handling for uploading a recipe spreadsheet.

Lee Morgan hace 5 años
padre
commit
3f9686fdc1
Se han modificado 2 ficheros con 2 adiciones y 16 borrados
  1. 1 8
      views/dashboardPage/bundle.js
  2. 1 8
      views/dashboardPage/js/sidebars/newRecipe.js

+ 1 - 8
views/dashboardPage/bundle.js

@@ -2249,14 +2249,7 @@ let newRecipe = {
                 if(typeof(response) === "string"){
                     controller.createBanner(response, "error");
                 }else{
-                    for(let i = 0; i < response.length; i++){
-                        merchant.addRecipe(
-                            response[i]._id,
-                            response[i].name,
-                            response[i].price,
-                            response[i].ingredients
-                        );
-                    }
+                    merchant.addRecipes(response);
 
                     controller.createBanner("ALL INGREDIENTS SUCCESSFULLY CREATED", "success");
                     controller.openStrand("recipeBook");

+ 1 - 8
views/dashboardPage/js/sidebars/newRecipe.js

@@ -131,14 +131,7 @@ let newRecipe = {
                 if(typeof(response) === "string"){
                     controller.createBanner(response, "error");
                 }else{
-                    for(let i = 0; i < response.length; i++){
-                        merchant.addRecipe(
-                            response[i]._id,
-                            response[i].name,
-                            response[i].price,
-                            response[i].ingredients
-                        );
-                    }
+                    merchant.addRecipes(response);
 
                     controller.createBanner("ALL INGREDIENTS SUCCESSFULLY CREATED", "success");
                     controller.openStrand("recipeBook");