1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Add notifications in the client

This commit is contained in:
Chocobozzz 2019-01-08 11:26:41 +01:00 committed by Chocobozzz
parent f7cc67b455
commit 2f1548fda3
56 changed files with 1073 additions and 112 deletions

View file

@ -45,6 +45,11 @@ myNotificationsRouter.post('/me/notifications/read',
asyncMiddleware(markAsReadUserNotifications)
)
myNotificationsRouter.post('/me/notifications/read-all',
authenticate,
asyncMiddleware(markAsReadAllUserNotifications)
)
export {
myNotificationsRouter
}
@ -70,7 +75,7 @@ async function updateNotificationSettings (req: express.Request, res: express.Re
myVideoImportFinished: body.myVideoImportFinished,
newFollow: body.newFollow,
newUserRegistration: body.newUserRegistration,
commentMention: body.commentMention,
commentMention: body.commentMention
}
await UserNotificationSettingModel.update(values, query)
@ -93,3 +98,11 @@ async function markAsReadUserNotifications (req: express.Request, res: express.R
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()
}