From 2f1548fda32c3ba9e53913270394eedfacd55986 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 8 Jan 2019 11:26:41 +0100 Subject: Add notifications in the client --- shared/utils/users/user-notifications.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'shared/utils/users') diff --git a/shared/utils/users/user-notifications.ts b/shared/utils/users/user-notifications.ts index 1222899e7..bcbe29fc7 100644 --- a/shared/utils/users/user-notifications.ts +++ b/shared/utils/users/user-notifications.ts @@ -54,6 +54,16 @@ function markAsReadNotifications (url: string, token: string, ids: number[], sta statusCodeExpected }) } +function markAsReadAllNotifications (url: string, token: string, statusCodeExpected = 204) { + const path = '/api/v1/users/me/notifications/read-all' + + return makePostBodyRequest({ + url, + path, + token, + statusCodeExpected + }) +} async function getLastNotification (serverUrl: string, accessToken: string) { const res = await getUserNotifications(serverUrl, accessToken, 0, 1, undefined, '-createdAt') @@ -409,6 +419,7 @@ export { CheckerBaseParams, CheckerType, checkNotification, + markAsReadAllNotifications, checkMyVideoImportIsFinished, checkUserRegistered, checkVideoIsPublished, -- cgit v1.2.3