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, });