From 372a209d32650edf168c1c4ebfbbc78c60ead249 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Sun, 14 Apr 2024 03:05:55 -1000 Subject: [PATCH] Prevent getting notifications from yourself --- server/api/api/v1/notifications/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/api/api/v1/notifications/index.ts b/server/api/api/v1/notifications/index.ts index 83a93a17..9594f898 100644 --- a/server/api/api/v1/notifications/index.ts +++ b/server/api/api/v1/notifications/index.ts @@ -90,7 +90,7 @@ 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, inArray, sql }, + { lt, gte, gt, and, or, eq, not }, ) => or( and( @@ -106,6 +106,7 @@ export default apiRoute( ), eq(notification.notifiedId, user.id), eq(notification.accountId, account_id), + not(eq(notification.accountId, user.id)), ), limit, // @ts-expect-error Yes I KNOW the types are wrong