summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/notifications
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api/endpoints/notifications')
-rw-r--r--src/server/api/endpoints/notifications/mark_all_as_read.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/server/api/endpoints/notifications/mark_all_as_read.ts b/src/server/api/endpoints/notifications/mark_all_as_read.ts
index 6487cd8b48..1b5208d447 100644
--- a/src/server/api/endpoints/notifications/mark_all_as_read.ts
+++ b/src/server/api/endpoints/notifications/mark_all_as_read.ts
@@ -1,6 +1,7 @@
import Notification from '../../../../models/notification';
import { publishMainStream } from '../../../../stream';
-import User, { ILocalUser } from '../../../../models/user';
+import User from '../../../../models/user';
+import define from '../../define';
export const meta = {
desc: {
@@ -13,10 +14,7 @@ export const meta = {
kind: 'notification-write'
};
-/**
- * Mark all notifications as read
- */
-export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
+export default define(meta, (ps, user) => new Promise(async (res, rej) => {
// Update documents
await Notification.update({
notifieeId: user._id,
@@ -41,4 +39,4 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
// 全ての通知を読みましたよというイベントを発行
publishMainStream(user._id, 'readAllNotifications');
-});
+}));