Просмотр исходного кода

Adding recipes from spreadsheet now checks against all lowercase.

Lee Morgan 5 лет назад
Родитель
Сommit
159d16763e
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      controllers/recipeData.js

+ 1 - 1
controllers/recipeData.js

@@ -183,7 +183,7 @@ module.exports = {
 
 
                     let exists = false;
                     let exists = false;
                     for(let j = 0; j < ingredients.length; j++){
                     for(let j = 0; j < ingredients.length; j++){
-                        if(ingredients[j].name === array[i][locations.ingredient]){
+                        if(ingredients[j].name.toLowerCase() === array[i][locations.ingredient].toLowerCase()){
                             currentRecipe.ingredients.push({
                             currentRecipe.ingredients.push({
                                 ingredient: ingredients[j].id,
                                 ingredient: ingredients[j].id,
                                 quantity: helper.convertQuantityToBaseUnit(array[i][locations.amount], ingredients[j].unit)
                                 quantity: helper.convertQuantityToBaseUnit(array[i][locations.amount], ingredients[j].unit)