summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/endpoints/i/notifications.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-11-02 15:57:55 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-11-02 15:57:55 +0900
commitf62ad3ed3eccfd242b2d1f1e25f00276f2bfff77 (patch)
tree4c7280ec000d49ae69f31b97fb1043d20c3de0f1 /packages/backend/src/server/api/endpoints/i/notifications.ts
parentfix(frontend): /about の連合タブのレイアウトが一部崩れてい... (diff)
downloadmisskey-f62ad3ed3eccfd242b2d1f1e25f00276f2bfff77.tar.gz
misskey-f62ad3ed3eccfd242b2d1f1e25f00276f2bfff77.tar.bz2
misskey-f62ad3ed3eccfd242b2d1f1e25f00276f2bfff77.zip
feat: notification grouping
Resolve #12211
Diffstat (limited to 'packages/backend/src/server/api/endpoints/i/notifications.ts')
-rw-r--r--packages/backend/src/server/api/endpoints/i/notifications.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/backend/src/server/api/endpoints/i/notifications.ts b/packages/backend/src/server/api/endpoints/i/notifications.ts
index 91dd72e805..039fd9454c 100644
--- a/packages/backend/src/server/api/endpoints/i/notifications.ts
+++ b/packages/backend/src/server/api/endpoints/i/notifications.ts
@@ -7,7 +7,7 @@ import { Brackets, In } from 'typeorm';
import * as Redis from 'ioredis';
import { Inject, Injectable } from '@nestjs/common';
import type { NotesRepository } from '@/models/_.js';
-import { obsoleteNotificationTypes, notificationTypes } from '@/types.js';
+import { obsoleteNotificationTypes, notificationTypes, FilterUnionByProperty } from '@/types.js';
import { Endpoint } from '@/server/api/endpoint-base.js';
import { NoteReadService } from '@/core/NoteReadService.js';
import { NotificationEntityService } from '@/core/entities/NotificationEntityService.js';
@@ -113,8 +113,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}
const noteIds = notifications
- .filter(notification => ['mention', 'reply', 'quote'].includes(notification.type))
- .map(notification => notification.noteId!);
+ .filter((notification): notification is FilterUnionByProperty<MiNotification, 'type', 'mention' | 'reply' | 'quote'> => ['mention', 'reply', 'quote'].includes(notification.type))
+ .map(notification => notification.noteId);
if (noteIds.length > 0) {
const notes = await this.notesRepository.findBy({ id: In(noteIds) });