From 74df0b360225b0bd11c528284134dccaaece6528 Mon Sep 17 00:00:00 2001 From: Crimekillz Date: Tue, 26 Mar 2024 16:24:19 +0100 Subject: [PATCH] Fix bug: Pass reference to Note OBJ when creating notifications for Poll Vote and Poll End so muted threads can be resolved correctly --- .../backend/src/queue/processors/ended-poll-notification.ts | 1 + packages/backend/src/services/note/polls/vote.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/packages/backend/src/queue/processors/ended-poll-notification.ts b/packages/backend/src/queue/processors/ended-poll-notification.ts index 3bf010a1b..c652d6216 100644 --- a/packages/backend/src/queue/processors/ended-poll-notification.ts +++ b/packages/backend/src/queue/processors/ended-poll-notification.ts @@ -28,6 +28,7 @@ export async function endedPollNotification( for (const userId of userIds) { createNotification(userId, "pollEnded", { + note: note, noteId: note.id, }); } diff --git a/packages/backend/src/services/note/polls/vote.ts b/packages/backend/src/services/note/polls/vote.ts index 582af0b17..1016e6aa9 100644 --- a/packages/backend/src/services/note/polls/vote.ts +++ b/packages/backend/src/services/note/polls/vote.ts @@ -67,6 +67,7 @@ export default async function ( // Notify createNotification(note.userId, "pollVote", { notifierId: user.id, + note: note, noteId: note.id, choice: choice, }); @@ -79,6 +80,7 @@ export default async function ( for (const watcher of watchers) { createNotification(watcher.userId, "pollVote", { notifierId: user.id, + note: note, noteId: note.id, choice: choice, });