diff options
| author | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-07-20 14:16:02 +0900 |
|---|---|---|
| committer | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-07-20 14:16:02 +0900 |
| commit | 5d09b7e38b42f19530d51feeeae0e57ad4320351 (patch) | |
| tree | f0e26bedf307603d87dbee9c7033699466e16b42 /src/server/api/endpoints | |
| parent | Update README.md (diff) | |
| download | sharkey-5d09b7e38b42f19530d51feeeae0e57ad4320351.tar.gz sharkey-5d09b7e38b42f19530d51feeeae0e57ad4320351.tar.bz2 sharkey-5d09b7e38b42f19530d51feeeae0e57ad4320351.zip | |
mark as read all -> mark all as read
Close #855
Diffstat (limited to 'src/server/api/endpoints')
| -rw-r--r-- | src/server/api/endpoints/i/notifications.ts | 2 | ||||
| -rw-r--r-- | src/server/api/endpoints/messaging/messages.ts | 10 | ||||
| -rw-r--r-- | src/server/api/endpoints/notifications/mark_all_as_read.ts (renamed from src/server/api/endpoints/notifications/mark_as_read_all.ts) | 16 |
3 files changed, 14 insertions, 14 deletions
diff --git a/src/server/api/endpoints/i/notifications.ts b/src/server/api/endpoints/i/notifications.ts index 6a1ba07a3a..b6865fba52 100644 --- a/src/server/api/endpoints/i/notifications.ts +++ b/src/server/api/endpoints/i/notifications.ts @@ -96,7 +96,7 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) = // Serialize res(await Promise.all(notifications.map(notification => pack(notification)))); - // Mark as read all + // Mark all as read if (notifications.length > 0 && markAsRead) { read(user._id, notifications); } diff --git a/src/server/api/endpoints/messaging/messages.ts b/src/server/api/endpoints/messaging/messages.ts index 84c28dc0c1..ae26419bc6 100644 --- a/src/server/api/endpoints/messaging/messages.ts +++ b/src/server/api/endpoints/messaging/messages.ts @@ -24,10 +24,10 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) = const recipient = await User.findOne({ _id: recipientId }, { - fields: { - _id: true - } - }); + fields: { + _id: true + } + }); if (recipient === null) { return rej('user not found'); @@ -96,7 +96,7 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) = return; } - // Mark as read all + // Mark all as read if (markAsRead) { read(user._id, recipient._id, messages); } diff --git a/src/server/api/endpoints/notifications/mark_as_read_all.ts b/src/server/api/endpoints/notifications/mark_all_as_read.ts index 7cf4cd16e9..91319d0553 100644 --- a/src/server/api/endpoints/notifications/mark_as_read_all.ts +++ b/src/server/api/endpoints/notifications/mark_all_as_read.ts @@ -5,7 +5,7 @@ import User, { ILocalUser } from '../../../../models/user'; export const meta = { desc: { ja: '全ての通知を既読にします。', - en: 'Mark as read all notifications.' + en: 'Mark all notifications as read.' }, requireCredential: true, @@ -14,7 +14,7 @@ export const meta = { }; /** - * Mark as read all notifications + * Mark all notifications as read */ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => { // Update documents @@ -22,12 +22,12 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) = notifieeId: user._id, isRead: false }, { - $set: { - isRead: true - } - }, { - multi: true - }); + $set: { + isRead: true + } + }, { + multi: true + }); // Response res(); |