This commit is contained in:
syuilo 2021-12-09 23:58:30 +09:00
parent 0abe2dfee0
commit c69b72e199
573 changed files with 3318 additions and 3318 deletions

View file

@ -28,7 +28,7 @@ export default async function(user: User, note: Note, choice: number) {
// if already voted
const exist = await PollVotes.find({
noteId: note.id,
userId: user.id
userId: user.id,
});
if (poll.multiple) {
@ -45,7 +45,7 @@ export default async function(user: User, note: Note, choice: number) {
createdAt: new Date(),
noteId: note.id,
userId: user.id,
choice: choice
choice: choice,
});
// Increment votes count
@ -54,14 +54,14 @@ export default async function(user: User, note: Note, choice: number) {
publishNoteStream(note.id, 'pollVoted', {
choice: choice,
userId: user.id
userId: user.id,
});
// Notify
createNotification(note.userId, 'pollVote', {
notifierId: user.id,
noteId: note.id,
choice: choice
choice: choice,
});
// Fetch watchers
@ -74,7 +74,7 @@ export default async function(user: User, note: Note, choice: number) {
createNotification(watcher.userId, 'pollVote', {
notifierId: user.id,
noteId: note.id,
choice: choice
choice: choice,
});
}
});