diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-10-04 13:53:48 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-10-04 13:53:48 +0900 |
| commit | fce7dc0f4e69053c7306289189b4fa4891f57339 (patch) | |
| tree | e18c90c403655fd52a137357499cd0de9a591bc1 /src/server | |
| parent | Improve default theme definition (dark) (diff) | |
| download | sharkey-fce7dc0f4e69053c7306289189b4fa4891f57339.tar.gz sharkey-fce7dc0f4e69053c7306289189b4fa4891f57339.tar.bz2 sharkey-fce7dc0f4e69053c7306289189b4fa4891f57339.zip | |
Improve error handling of pack function of notification
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/api/endpoints/i/notifications.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/api/endpoints/i/notifications.ts b/src/server/api/endpoints/i/notifications.ts index 46242b9d9f..5cc836e362 100644 --- a/src/server/api/endpoints/i/notifications.ts +++ b/src/server/api/endpoints/i/notifications.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; import ID from '../../../../misc/cafy-id'; import Notification from '../../../../models/notification'; import Mute from '../../../../models/mute'; -import { pack } from '../../../../models/notification'; +import { packMany } from '../../../../models/notification'; import { getFriendIds } from '../../common/get-friends'; import read from '../../common/read-notification'; import { ILocalUser } from '../../../../models/user'; @@ -83,7 +83,7 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) = }); // Serialize - res(await Promise.all(notifications.map(notification => pack(notification)))); + res(await packMany(notifications)); // Mark all as read if (notifications.length > 0 && markAsRead) { |