summaryrefslogtreecommitdiff
path: root/src/api/endpoints/i/notifications.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-10-30 22:12:10 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-10-30 22:12:10 +0900
commitcaa47cb38cfc3950539c78ca2e70f2c50e815d2c (patch)
treefc1a70e1c1b105ecf8d74ff4d952eff86ded83f6 /src/api/endpoints/i/notifications.ts
parenti18n (diff)
downloadsharkey-caa47cb38cfc3950539c78ca2e70f2c50e815d2c.tar.gz
sharkey-caa47cb38cfc3950539c78ca2e70f2c50e815d2c.tar.bz2
sharkey-caa47cb38cfc3950539c78ca2e70f2c50e815d2c.zip
未読の通知がある場合アイコンを表示するように
Diffstat (limited to 'src/api/endpoints/i/notifications.ts')
-rw-r--r--src/api/endpoints/i/notifications.ts14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/api/endpoints/i/notifications.ts b/src/api/endpoints/i/notifications.ts
index 5575fb7412..607e0768a4 100644
--- a/src/api/endpoints/i/notifications.ts
+++ b/src/api/endpoints/i/notifications.ts
@@ -5,6 +5,7 @@ import $ from 'cafy';
import Notification from '../../models/notification';
import serialize from '../../serializers/notification';
import getFriends from '../../common/get-friends';
+import read from '../../common/read-notification';
/**
* Get notifications
@@ -91,17 +92,6 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
// Mark as read all
if (notifications.length > 0 && markAsRead) {
- const ids = notifications
- .filter(x => x.is_read == false)
- .map(x => x._id);
-
- // Update documents
- await Notification.update({
- _id: { $in: ids }
- }, {
- $set: { is_read: true }
- }, {
- multi: true
- });
+ read(user._id, notifications);
}
});