From 186d7bbfd9908c8237d3d40ce1863e38aefa9c78 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 13 Apr 2019 19:08:41 +0900 Subject: [PATCH] Fix bug --- src/services/note/polls/vote.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/note/polls/vote.ts b/src/services/note/polls/vote.ts index 73fc37ff8..0955e4f80 100644 --- a/src/services/note/polls/vote.ts +++ b/src/services/note/polls/vote.ts @@ -40,7 +40,7 @@ export default async function(user: User, note: Note, choice: number) { // Increment votes count const index = choice + 1; // In SQL, array index is 1 based - await Polls.query(`UPDATE poll SET votes[${index}] = votes[${index}] + 1 WHERE noteId = '${poll.noteId}'`); + await Polls.query(`UPDATE poll SET votes[${index}] = votes[${index}] + 1 WHERE "noteId" = '${poll.noteId}'`); publishNoteStream(note.id, 'pollVoted', { choice: choice,