瀏覽代碼

Update state handling for uploading a recipe spreadsheet.

Lee Morgan 5 年之前
父節點
當前提交
3f9686fdc1
共有 2 個文件被更改,包括 2 次插入16 次删除
  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");