From 1cd67da1a14c1ca581370a3167324c27e99dc516 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sat, 19 Feb 2022 16:19:54 +0900 Subject: [PATCH] :v: --- .../src/server/api/endpoints/notifications/read.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notifications/read.ts b/packages/backend/src/server/api/endpoints/notifications/read.ts index 659cc1e033..65c78ffb13 100644 --- a/packages/backend/src/server/api/endpoints/notifications/read.ts +++ b/packages/backend/src/server/api/endpoints/notifications/read.ts @@ -43,10 +43,6 @@ const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { - let notificationIds = [] as string[]; - - if (ps.notificationId) notificationIds.push(ps.notificationId); - if (ps.notificationIds) notificationIds = notificationIds.concat(ps.notificationIds); - - return readNotification(user.id, notificationIds); + if ('notificationId' in ps) return readNotification(user.id, [ps.notificationId]); + return readNotification(user.id, ps.notificationIds); });