backend: Fix thread muting queries #175

Manually merged
norm merged 1 commit from Michcio/FoundKey-0x7f:fix-findoneby into main 2022-09-25 16:58:55 +00:00
3 changed files with 3 additions and 3 deletions

View file

@ -137,7 +137,7 @@ export default define(meta, paramDef, async (ps, user) => {
});
// check if this thread and notification type is muted
const threadMuted = await NoteThreadMutings.findOne({
const threadMuted = await NoteThreadMutings.findOneBy({
userId: note.userId,
threadId: note.threadId || note.id,
mutingNotificationTypes: ArrayOverlap(['pollVote']),

View file

@ -58,7 +58,7 @@ export default async function(user: CacheableUser, note: Note, choice: number) {
});
// check if this thread and notification type is muted
const muted = await NoteThreadMutings.findOne({
const muted = await NoteThreadMutings.findOneBy({
userId: note.userId,
threadId: note.threadId || note.id,
mutingNotificationTypes: ArrayOverlap(['pollVote']),

View file

@ -99,7 +99,7 @@ export default async (user: { id: User['id']; host: User['host']; }, note: Note,
});
// check if this thread is muted
const threadMuted = await NoteThreadMutings.findOne({
const threadMuted = await NoteThreadMutings.findOneBy({
userId: note.userId,
threadId: note.threadId || note.id,
mutingNotificationTypes: ArrayOverlap(['reaction']),