asyncMiddleware(markAsReadUserNotifications)
)
+myNotificationsRouter.post('/me/notifications/read-all',
+ authenticate,
+ asyncMiddleware(markAsReadAllUserNotifications)
+)
+
export {
myNotificationsRouter
}
myVideoImportFinished: body.myVideoImportFinished,
newFollow: body.newFollow,
newUserRegistration: body.newUserRegistration,
- commentMention: body.commentMention,
+ commentMention: body.commentMention
}
await UserNotificationSettingModel.update(values, query)
return res.status(204).end()
}
+
+async function markAsReadAllUserNotifications (req: express.Request, res: express.Response) {
+ const user: UserModel = res.locals.oauth.token.User
+
+ await UserNotificationModel.markAllAsRead(user.id)
+
+ return res.status(204).end()
+}