diff --git a/server/api/api/v1/notifications/index.ts b/server/api/api/v1/notifications/index.ts index 9594f898..3d120245 100644 --- a/server/api/api/v1/notifications/index.ts +++ b/server/api/api/v1/notifications/index.ts @@ -90,23 +90,23 @@ export default apiRoute( // @ts-expect-error Yes I KNOW the types are wrong notification, // @ts-expect-error Yes I KNOW the types are wrong - { lt, gte, gt, and, or, eq, not }, + { lt, gte, gt, and, eq, not, inArray }, ) => - or( - and( - max_id - ? lt(notification.id, max_id) - : undefined, - since_id - ? gte(notification.id, since_id) - : undefined, - min_id - ? gt(notification.id, min_id) - : undefined, - ), + and( + max_id ? lt(notification.id, max_id) : undefined, + since_id + ? gte(notification.id, since_id) + : undefined, + min_id ? gt(notification.id, min_id) : undefined, eq(notification.notifiedId, user.id), eq(notification.accountId, account_id), not(eq(notification.accountId, user.id)), + types + ? inArray(notification.type, types) + : undefined, + exclude_types + ? not(inArray(notification.type, exclude_types)) + : undefined, ), limit, // @ts-expect-error Yes I KNOW the types are wrong