Correct wrong notification endpoint returns

This commit is contained in:
Jesse Wierzbinski 2024-04-14 03:11:15 -10:00
parent 372a209d32
commit 55ea57391b
No known key found for this signature in database

View file

@ -90,23 +90,23 @@ export default apiRoute<typeof meta, typeof schema>(
// @ts-expect-error Yes I KNOW the types are wrong // @ts-expect-error Yes I KNOW the types are wrong
notification, notification,
// @ts-expect-error Yes I KNOW the types are wrong // @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( and(
max_id max_id ? lt(notification.id, max_id) : undefined,
? lt(notification.id, max_id)
: undefined,
since_id since_id
? gte(notification.id, since_id) ? gte(notification.id, since_id)
: undefined, : undefined,
min_id min_id ? gt(notification.id, min_id) : undefined,
? gt(notification.id, min_id)
: undefined,
),
eq(notification.notifiedId, user.id), eq(notification.notifiedId, user.id),
eq(notification.accountId, account_id), eq(notification.accountId, account_id),
not(eq(notification.accountId, user.id)), not(eq(notification.accountId, user.id)),
types
? inArray(notification.type, types)
: undefined,
exclude_types
? not(inArray(notification.type, exclude_types))
: undefined,
), ),
limit, limit,
// @ts-expect-error Yes I KNOW the types are wrong // @ts-expect-error Yes I KNOW the types are wrong