From 857c88e8d63599f854f55510329083aab9021176 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 28 May 2021 22:52:30 +0900 Subject: [PATCH] fix type --- src/server/api/endpoints/i/notifications.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/api/endpoints/i/notifications.ts b/src/server/api/endpoints/i/notifications.ts index b481fdba8..c597a28eb 100644 --- a/src/server/api/endpoints/i/notifications.ts +++ b/src/server/api/endpoints/i/notifications.ts @@ -103,9 +103,9 @@ export default define(meta, async (ps, user) => { query.setParameters(followingQuery.getParameters()); } - if (ps.includeTypes?.length > 0) { + if (ps.includeTypes && ps.includeTypes.length > 0) { query.andWhere(`notification.type IN (:...includeTypes)`, { includeTypes: ps.includeTypes }); - } else if (ps.excludeTypes?.length > 0) { + } else if (ps.excludeTypes && ps.excludeTypes.length > 0) { query.andWhere(`notification.type NOT IN (:...excludeTypes)`, { excludeTypes: ps.excludeTypes }); }