diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-10-16 19:55:44 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-10-16 19:55:44 +0900 |
| commit | 8a1f3a4c0b5732d0f08f0788d93c5934de8960c8 (patch) | |
| tree | be6fbcf3a1bbd78306d91e19ef6f3e7023f41561 /src/server/api/endpoints/i | |
| parent | Merge branch 'develop' (diff) | |
| parent | 12.92.0 (diff) | |
| download | misskey-8a1f3a4c0b5732d0f08f0788d93c5934de8960c8.tar.gz misskey-8a1f3a4c0b5732d0f08f0788d93c5934de8960c8.tar.bz2 misskey-8a1f3a4c0b5732d0f08f0788d93c5934de8960c8.zip | |
Merge branch 'develop'
Diffstat (limited to 'src/server/api/endpoints/i')
| -rw-r--r-- | src/server/api/endpoints/i/notifications.ts | 11 | ||||
| -rw-r--r-- | src/server/api/endpoints/i/update.ts | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/server/api/endpoints/i/notifications.ts b/src/server/api/endpoints/i/notifications.ts index 3c265a10c1..fcabbbc3dd 100644 --- a/src/server/api/endpoints/i/notifications.ts +++ b/src/server/api/endpoints/i/notifications.ts @@ -4,7 +4,7 @@ import { readNotification } from '../../common/read-notification'; import define from '../../define'; import { makePaginationQuery } from '../../common/make-pagination-query'; import { Notifications, Followings, Mutings, Users } from '@/models/index'; -import { notificationTypes } from '../../../../types'; +import { notificationTypes } from '@/types'; import read from '@/services/note/read'; export const meta = { @@ -33,6 +33,11 @@ export const meta = { default: false }, + unreadOnly: { + validator: $.optional.bool, + default: false + }, + markAsRead: { validator: $.optional.bool, default: true @@ -105,6 +110,10 @@ export default define(meta, async (ps, user) => { query.andWhere(`notification.type NOT IN (:...excludeTypes)`, { excludeTypes: ps.excludeTypes }); } + if (ps.unreadOnly) { + query.andWhere(`notification.isRead = false`); + } + const notifications = await query.take(ps.limit!).getMany(); // Mark all as read diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts index fb7e12760e..9dd637251d 100644 --- a/src/server/api/endpoints/i/update.ts +++ b/src/server/api/endpoints/i/update.ts @@ -13,7 +13,7 @@ import { ApiError } from '../../error'; import { Users, DriveFiles, UserProfiles, Pages } from '@/models/index'; import { User } from '@/models/entities/user'; import { UserProfile } from '@/models/entities/user-profile'; -import { notificationTypes } from '../../../../types'; +import { notificationTypes } from '@/types'; import { normalizeForSearch } from '@/misc/normalize-for-search'; export const meta = { |