diff --git a/server/src/service.ts b/server/src/service.ts index 344d1ff..a0d4eeb 100644 --- a/server/src/service.ts +++ b/server/src/service.ts @@ -244,7 +244,7 @@ export async function removeChoice(login: string, trusted: boolean, locationKey: if (locationKey in data.choices) { if (data.choices[locationKey] && login in data.choices[locationKey]) { const index = data.choices[locationKey][login].selectedFoods?.indexOf(foodIndex); - if (index && index > -1) { + if (index != null && index > -1) { data.choices[locationKey][login].selectedFoods?.splice(index, 1); await storage.setData(selectedDay, data); }