summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/i/notifications.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2019-04-13 01:43:22 +0900
committerGitHub <noreply@github.com>2019-04-13 01:43:22 +0900
commit987168b863c52d0548050ffbac569782bb9a8cef (patch)
treec9aa2243dcdcbd044688d201a51c601574bff259 /src/server/api/endpoints/i/notifications.ts
parentFix bug (diff)
downloadsharkey-987168b863c52d0548050ffbac569782bb9a8cef.tar.gz
sharkey-987168b863c52d0548050ffbac569782bb9a8cef.tar.bz2
sharkey-987168b863c52d0548050ffbac569782bb9a8cef.zip
strictNullChecks (#4666)
* wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip
Diffstat (limited to 'src/server/api/endpoints/i/notifications.ts')
-rw-r--r--src/server/api/endpoints/i/notifications.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/api/endpoints/i/notifications.ts b/src/server/api/endpoints/i/notifications.ts
index 9b016e0a2d..56074c9d00 100644
--- a/src/server/api/endpoints/i/notifications.ts
+++ b/src/server/api/endpoints/i/notifications.ts
@@ -81,13 +81,13 @@ export default define(meta, async (ps, user) => {
query.setParameters(followingQuery.getParameters());
}
- if (ps.includeTypes.length > 0) {
+ if (ps.includeTypes!.length > 0) {
query.andWhere(`notification.type IN (:...includeTypes)`, { includeTypes: ps.includeTypes });
- } else if (ps.excludeTypes.length > 0) {
+ } else if (ps.excludeTypes!.length > 0) {
query.andWhere(`notification.type NOT IN (:...excludeTypes)`, { excludeTypes: ps.excludeTypes });
}
- const notifications = await query.take(ps.limit).getMany();
+ const notifications = await query.take(ps.limit!).getMany();
// Mark all as read
if (notifications.length > 0 && ps.markAsRead) {