refactor: seperated addedSyrups from standard
This commit is contained in:
parent
2e713ee078
commit
968a79335c
@ -8,8 +8,9 @@ function createDrink(){
|
||||
assigned: false,
|
||||
shotType: shotTypes.NORMAL,
|
||||
syrups: [],
|
||||
addedSyrups: [],
|
||||
milk: milkTypes.NONE
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@ -139,12 +140,12 @@ function addSyrup(drink, syrup, qunatity){
|
||||
count: pumps
|
||||
}
|
||||
|
||||
let otherSyrups = _.without(drink.recipe.syrups, _.findWhere(drink.recipe.syrups, {
|
||||
let otherSyrups = _.without(drink.recipe.addedSyrups, _.findWhere(drink.recipe.addedSyrups, {
|
||||
name: syrup
|
||||
}));
|
||||
|
||||
otherSyrups.push(s);
|
||||
drink.recipe.syrups = otherSyrups;
|
||||
drink.recipe.addedSyrups = otherSyrups;
|
||||
|
||||
return drink;
|
||||
}
|
||||
|
@ -80,8 +80,8 @@ function orderDisplay(drink){
|
||||
o.caffeine = ""
|
||||
}
|
||||
|
||||
if(drink.recipe.syrups.length > 0){
|
||||
drink.recipe.syrups.forEach(function(e) {
|
||||
if(drink.recipe.addedSyrups.length > 0){
|
||||
drink.recipe.addedSyrups.forEach(function(e) {
|
||||
o.syrups += e.name + "<br>"
|
||||
}, this);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user