aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos/video-history.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-12-07 14:32:36 +0100
committerGitHub <noreply@github.com>2020-12-07 14:32:36 +0100
commit2d53be0267acc49cda46707b885096193a1f4e9c (patch)
tree887061a34bc67f40acbb96a6278f9544bf83caeb /shared/extra-utils/videos/video-history.ts
parentadc1f09c0dbd997f34028c1c82d1c118dc8ead80 (diff)
downloadPeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.gz
PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.zst
PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.zip
replace numbers with typed http status codes (#3409)
Diffstat (limited to 'shared/extra-utils/videos/video-history.ts')
-rw-r--r--shared/extra-utils/videos/video-history.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/shared/extra-utils/videos/video-history.ts b/shared/extra-utils/videos/video-history.ts
index dc7095b4d..2d751cf14 100644
--- a/shared/extra-utils/videos/video-history.ts
+++ b/shared/extra-utils/videos/video-history.ts
@@ -1,4 +1,5 @@
1import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests' 1import { makeGetRequest, makePostBodyRequest, makePutBodyRequest } from '../requests/requests'
2import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
2 3
3function userWatchVideo (url: string, token: string, videoId: number | string, currentTime: number, statusCodeExpected = 204) { 4function userWatchVideo (url: string, token: string, videoId: number | string, currentTime: number, statusCodeExpected = 204) {
4 const path = '/api/v1/videos/' + videoId + '/watching' 5 const path = '/api/v1/videos/' + videoId + '/watching'
@@ -14,7 +15,7 @@ function listMyVideosHistory (url: string, token: string) {
14 url, 15 url,
15 path, 16 path,
16 token, 17 token,
17 statusCodeExpected: 200 18 statusCodeExpected: HttpStatusCode.OK_200
18 }) 19 })
19} 20}
20 21
@@ -26,7 +27,7 @@ function removeMyVideosHistory (url: string, token: string, beforeDate?: string)
26 path, 27 path,
27 token, 28 token,
28 fields: beforeDate ? { beforeDate } : {}, 29 fields: beforeDate ? { beforeDate } : {},
29 statusCodeExpected: 204 30 statusCodeExpected: HttpStatusCode.NO_CONTENT_204
30 }) 31 })
31} 32}
32 33