diff --git a/frontend/src/lib/components/SuggestionList.svelte b/frontend/src/lib/components/SuggestionList.svelte index 6f5d649..193b33c 100644 --- a/frontend/src/lib/components/SuggestionList.svelte +++ b/frontend/src/lib/components/SuggestionList.svelte @@ -7,9 +7,8 @@ let picked_suggestions: string[] = $state([]) - async function vote(idx: number, amount: number, songId: string) { + async function vote(amount: number, songId: string) { if (picked_suggestions.includes(songId)) return console.log("rejecting vote") - suggestions[idx].upvote += amount await fetch(`/api/song/voting?room=${roomId}&song=${songId}&increment=${amount}`, { method: "POST" }) picked_suggestions.push(songId) console.log("accepted vote") @@ -26,7 +25,7 @@
No suggestions yet! Try to add a new one using the Add button
{/if} - {#each suggestions as sug, idx} + {#each suggestions as sug}