This commit is contained in:
syuilo
2019-04-10 20:07:36 +09:00
parent 2a40240310
commit c28f4ffb3f
8 changed files with 4 additions and 12 deletions

View File

@ -123,7 +123,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 id = '${poll.id}'`);
await Polls.query(`UPDATE poll SET votes[${index}] = votes[${index}] + 1 WHERE noteId = '${poll.noteId}'`);
publishNoteStream(note.id, 'pollVoted', {
choice: ps.choice,