refactor: seperated addedSyrups from standard

This commit is contained in:
Joshua Shoemaker 2017-01-30 21:43:49 -06:00
parent 2e713ee078
commit 968a79335c
2 changed files with 6 additions and 5 deletions

View File

@ -8,8 +8,9 @@ function createDrink(){
assigned: false, assigned: false,
shotType: shotTypes.NORMAL, shotType: shotTypes.NORMAL,
syrups: [], syrups: [],
addedSyrups: [],
milk: milkTypes.NONE milk: milkTypes.NONE
} },
} }
} }
@ -139,12 +140,12 @@ function addSyrup(drink, syrup, qunatity){
count: pumps count: pumps
} }
let otherSyrups = _.without(drink.recipe.syrups, _.findWhere(drink.recipe.syrups, { let otherSyrups = _.without(drink.recipe.addedSyrups, _.findWhere(drink.recipe.addedSyrups, {
name: syrup name: syrup
})); }));
otherSyrups.push(s); otherSyrups.push(s);
drink.recipe.syrups = otherSyrups; drink.recipe.addedSyrups = otherSyrups;
return drink; return drink;
} }

View File

@ -80,8 +80,8 @@ function orderDisplay(drink){
o.caffeine = "" o.caffeine = ""
} }
if(drink.recipe.syrups.length > 0){ if(drink.recipe.addedSyrups.length > 0){
drink.recipe.syrups.forEach(function(e) { drink.recipe.addedSyrups.forEach(function(e) {
o.syrups += e.name + "<br>" o.syrups += e.name + "<br>"
}, this); }, this);
} }