Prevent getting notifications from yourself

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

View file

@ -90,7 +90,7 @@ 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, inArray, sql }, { lt, gte, gt, and, or, eq, not },
) => ) =>
or( or(
and( and(
@ -106,6 +106,7 @@ export default apiRoute<typeof meta, typeof schema>(
), ),
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)),
), ),
limit, limit,
// @ts-expect-error Yes I KNOW the types are wrong // @ts-expect-error Yes I KNOW the types are wrong