Browse Source

Change name from addIngredients to editIngredients

Lee Morgan 6 years ago
parent
commit
52b3b7aae9
2 changed files with 4 additions and 4 deletions
  1. 1 1
      views/dashboardPage/Merchant.js
  2. 3 3
      views/dashboardPage/components/components.js

+ 1 - 1
views/dashboardPage/Merchant.js

@@ -105,7 +105,7 @@ class Merchant{
     }
     remove = set true if removing
     */
-    addIngredients(ingredients, remove = false){
+    editIngredients(ingredients, remove = false){
         console.log(ingredients);
         for(let i = 0; i < ingredients.length; i++){
             let isNew = true;

+ 3 - 3
views/dashboardPage/components/components.js

@@ -288,7 +288,7 @@ let newIngredientComp = {
                     if(typeof(response) === "string"){
                         banner.createError(response);
                     }else{
-                        merchant.addIngredients([{
+                        merchant.editIngredients([{
                             ingredient: new Ingredient(
                                 response.ingredient._id,
                                 response.ingredient.name,
@@ -543,7 +543,7 @@ let addIngredientsComp = {
                 if(typeof(response) === "string"){
                     banner.createError(response);
                 }else{
-                    merchant.addIngredients(newIngredients);
+                    merchant.editIngredients(newIngredients);
                     banner.createNotification("All ingredients added successfully");
                 }
             })
@@ -627,7 +627,7 @@ let ingredientDetailsComp = {
                     banner.createError(response);
                 }else{
                     banner.createNotification("Ingredient removed");
-                    merchant.addIngredients([this.ingredient], true);
+                    merchant.editIngredients([this.ingredient], true);
                 }
             })
             .catch((err)=>{});