diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-04-10 20:07:36 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-04-10 20:07:36 +0900 |
| commit | c28f4ffb3f5d67125abe3da9af60f05233f663a7 (patch) | |
| tree | 7a4af744ff75414385bea75f3494cafdacc3680b /src/services | |
| parent | Fix bug (diff) | |
| download | sharkey-c28f4ffb3f5d67125abe3da9af60f05233f663a7.tar.gz sharkey-c28f4ffb3f5d67125abe3da9af60f05233f663a7.tar.bz2 sharkey-c28f4ffb3f5d67125abe3da9af60f05233f663a7.zip | |
Clean up
Diffstat (limited to 'src/services')
| -rw-r--r-- | src/services/note/create.ts | 1 | ||||
| -rw-r--r-- | src/services/note/polls/vote.ts | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/src/services/note/create.ts b/src/services/note/create.ts index 6058fada16..bc1225cd4d 100644 --- a/src/services/note/create.ts +++ b/src/services/note/create.ts @@ -398,7 +398,6 @@ async function insertNote(user: User, data: Option, tags: string[], emojis: stri if (note.hasPoll) { await Polls.save({ - id: genId(), noteId: note.id, choices: data.poll.choices, expiresAt: data.poll.expiresAt, diff --git a/src/services/note/polls/vote.ts b/src/services/note/polls/vote.ts index 95e5b3ef3a..3051ff42d9 100644 --- a/src/services/note/polls/vote.ts +++ b/src/services/note/polls/vote.ts @@ -40,7 +40,7 @@ export default (user: User, note: Note, choice: number) => new Promise(async (re // 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 id = '${poll.id}'`); + await Polls.query(`UPDATE poll SET votes[${index}] = votes[${index}] + 1 WHERE noteId = '${poll.noteId}'`); publishNoteStream(note.id, 'pollVoted', { choice: choice, |