From 789d05bed3a7092a44ed958fa1def0562ec5bd5c Mon Sep 17 00:00:00 2001 From: naskya Date: Sat, 30 Sep 2023 18:50:05 +0900 Subject: [PATCH] fix: this "else" is unneeded --- packages/backend/src/server/api/endpoints/notes/search.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/search.ts b/packages/backend/src/server/api/endpoints/notes/search.ts index 8c5798b62d..ca64017fa4 100644 --- a/packages/backend/src/server/api/endpoints/notes/search.ts +++ b/packages/backend/src/server/api/endpoints/notes/search.ts @@ -75,9 +75,11 @@ export default define(meta, paramDef, async (ps, me) => { ps.untilId, ); - if (ps.userId) { + if (ps.userId != null) { query.andWhere("note.userId = :userId", { userId: ps.userId }); - } else if (ps.channelId) { + } + + if (ps.channelId != null) { query.andWhere("note.channelId = :channelId", { channelId: ps.channelId, });