Selaa lähdekoodia

Update recipeData.js to handle new bottle data structure.

Lee Morgan 5 vuotta sitten
vanhempi
sitoutus
80807cbb1c
1 muutettua tiedostoa jossa 4 lisäystä ja 11 poistoa
  1. 4 11
      controllers/recipeData.js

+ 4 - 11
controllers/recipeData.js

@@ -387,17 +387,10 @@ module.exports = {
                     let exists = false;
                     for(let j = 0; j < ingredients.length; j++){
                         if(ingredients[j].name === array[i][locations.ingredient]){
-                            if(ingredients[j].specialUnit = "bottle"){
-                                currentRecipe.ingredients.push({
-                                    ingredient: ingredients[j].id,
-                                    quantity: array[i][locations.amount]
-                                });
-                            }else{
-                                currentRecipe.ingredients.push({
-                                    ingredient: ingredients[j].id,
-                                    quantity: helper.convertQuantityToBaseUnit(array[i][locations.amount], ingredients[j].unit)
-                                });
-                            }
+                            currentRecipe.ingredients.push({
+                                ingredient: ingredients[j].id,
+                                quantity: helper.convertQuantityToBaseUnit(array[i][locations.amount], ingredients[j].unit)
+                            });
 
                             exists = true;
                             break;