This commit is contained in:
syuilo 2019-04-13 17:24:56 +09:00
parent 96099ffe98
commit 69662e24c3
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69

View File

@ -124,7 +124,7 @@ export default define(meta, async (ps, user) => {
// Increment votes count
const index = ps.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: ps.choice,