Check if person exists before allowing add

This commit is contained in:
jableader 2024-05-19 22:12:15 +10:00
parent 4664cc96f3
commit 2ceaf3d923

View file

@ -99,6 +99,10 @@ export default {
this.meal[list] = this.meal[list].filter(p => p.id !== person.id); this.meal[list] = this.meal[list].filter(p => p.id !== person.id);
}, },
addPerson(list, person) { addPerson(list, person) {
if (this.meal[list].find(p => p.id === person.id)) {
return;
}
this.meal[list].push(person); this.meal[list].push(person);
}, },
async saveMeal() { async saveMeal() {