Bladeren bron

Remove dead code from merchant on frontend.

Lee Morgan 5 jaren geleden
bovenliggende
commit
af7cef0c21
2 gewijzigde bestanden met toevoegingen van 0 en 58 verwijderingen
  1. 0 29
      views/dashboardPage/bundle.js
  2. 0 29
      views/dashboardPage/js/classes/Merchant.js

+ 0 - 29
views/dashboardPage/bundle.js

@@ -700,35 +700,6 @@ class Merchant{
         return ingredientsByCategory;
     }
 
-    unitizeIngredients(){
-        let ingredientsByUnit = [];
-
-        for(let i = 0; i < this.ingredients.length; i++){
-            let unitExists = false;
-            const innerIngredient = this.ingredients[i].ingredient;
-            for(let j = 0; j < ingredientsByUnit.length; j++){
-                if(innerIngredient.unit === ingredientsByUnit[j].name || innerIngredient.specialUnit === ingredientsByUnit[j].name){
-                    ingredientsByUnit[j].ingredients.push(this.ingredients[i]);
-
-                    unitExists = true;
-                    break;
-                }
-            }
-
-            if(!unitExists){
-                let unit = "";
-                unit = innerIngredient.unit;
-                
-                ingredientsByUnit.push({
-                    name: unit,
-                    ingredients: [this.ingredients[i]]
-                });
-            }
-        }
-
-        return ingredientsByUnit;
-    }
-
     getRecipesForIngredient(ingredient){
         let recipes = [];
 

+ 0 - 29
views/dashboardPage/js/classes/Merchant.js

@@ -584,35 +584,6 @@ class Merchant{
         return ingredientsByCategory;
     }
 
-    unitizeIngredients(){
-        let ingredientsByUnit = [];
-
-        for(let i = 0; i < this.ingredients.length; i++){
-            let unitExists = false;
-            const innerIngredient = this.ingredients[i].ingredient;
-            for(let j = 0; j < ingredientsByUnit.length; j++){
-                if(innerIngredient.unit === ingredientsByUnit[j].name || innerIngredient.specialUnit === ingredientsByUnit[j].name){
-                    ingredientsByUnit[j].ingredients.push(this.ingredients[i]);
-
-                    unitExists = true;
-                    break;
-                }
-            }
-
-            if(!unitExists){
-                let unit = "";
-                unit = innerIngredient.unit;
-                
-                ingredientsByUnit.push({
-                    name: unit,
-                    ingredients: [this.ingredients[i]]
-                });
-            }
-        }
-
-        return ingredientsByUnit;
-    }
-
     getRecipesForIngredient(ingredient){
         let recipes = [];