refactor: seperated addedSyrups from standard
This commit is contained in:
parent
2e713ee078
commit
968a79335c
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user