diff options
author | Chocobozzz <me@florianbigard.com> | 2019-01-08 11:26:41 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-01-09 11:15:15 +0100 |
commit | 2f1548fda32c3ba9e53913270394eedfacd55986 (patch) | |
tree | afee28df36a9e00f921603d9091e5d08d5818159 /shared/utils/users | |
parent | f7cc67b455a12ccae9b0ea16876d166720364357 (diff) | |
download | PeerTube-2f1548fda32c3ba9e53913270394eedfacd55986.tar.gz PeerTube-2f1548fda32c3ba9e53913270394eedfacd55986.tar.zst PeerTube-2f1548fda32c3ba9e53913270394eedfacd55986.zip |
Add notifications in the client
Diffstat (limited to 'shared/utils/users')
-rw-r--r-- | shared/utils/users/user-notifications.ts | 11 |
1 files changed, 11 insertions, 0 deletions
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 | |||
54 | statusCodeExpected | 54 | statusCodeExpected |
55 | }) | 55 | }) |
56 | } | 56 | } |
57 | function markAsReadAllNotifications (url: string, token: string, statusCodeExpected = 204) { | ||
58 | const path = '/api/v1/users/me/notifications/read-all' | ||
59 | |||
60 | return makePostBodyRequest({ | ||
61 | url, | ||
62 | path, | ||
63 | token, | ||
64 | statusCodeExpected | ||
65 | }) | ||
66 | } | ||
57 | 67 | ||
58 | async function getLastNotification (serverUrl: string, accessToken: string) { | 68 | async function getLastNotification (serverUrl: string, accessToken: string) { |
59 | const res = await getUserNotifications(serverUrl, accessToken, 0, 1, undefined, '-createdAt') | 69 | const res = await getUserNotifications(serverUrl, accessToken, 0, 1, undefined, '-createdAt') |
@@ -409,6 +419,7 @@ export { | |||
409 | CheckerBaseParams, | 419 | CheckerBaseParams, |
410 | CheckerType, | 420 | CheckerType, |
411 | checkNotification, | 421 | checkNotification, |
422 | markAsReadAllNotifications, | ||
412 | checkMyVideoImportIsFinished, | 423 | checkMyVideoImportIsFinished, |
413 | checkUserRegistered, | 424 | checkUserRegistered, |
414 | checkVideoIsPublished, | 425 | checkVideoIsPublished, |