aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos/live.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/live.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/live.ts')
-rw-r--r--shared/extra-utils/videos/live.ts13
1 files changed, 10 insertions, 3 deletions
diff --git a/shared/extra-utils/videos/live.ts b/shared/extra-utils/videos/live.ts
index 522beb8bc..4aa66622b 100644
--- a/shared/extra-utils/videos/live.ts
+++ b/shared/extra-utils/videos/live.ts
@@ -10,8 +10,9 @@ import { buildAbsoluteFixturePath, buildServerDirectory, wait } from '../miscs/m
10import { makeGetRequest, makePutBodyRequest, makeUploadRequest } from '../requests/requests' 10import { makeGetRequest, makePutBodyRequest, makeUploadRequest } from '../requests/requests'
11import { ServerInfo } from '../server/servers' 11import { ServerInfo } from '../server/servers'
12import { getVideoWithToken } from './videos' 12import { getVideoWithToken } from './videos'
13import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
13 14
14function getLive (url: string, token: string, videoId: number | string, statusCodeExpected = 200) { 15function getLive (url: string, token: string, videoId: number | string, statusCodeExpected = HttpStatusCode.OK_200) {
15 const path = '/api/v1/videos/live' 16 const path = '/api/v1/videos/live'
16 17
17 return makeGetRequest({ 18 return makeGetRequest({
@@ -22,7 +23,13 @@ function getLive (url: string, token: string, videoId: number | string, statusCo
22 }) 23 })
23} 24}
24 25
25function updateLive (url: string, token: string, videoId: number | string, fields: LiveVideoUpdate, statusCodeExpected = 204) { 26function updateLive (
27 url: string,
28 token: string,
29 videoId: number | string,
30 fields: LiveVideoUpdate,
31 statusCodeExpected = HttpStatusCode.NO_CONTENT_204
32) {
26 const path = '/api/v1/videos/live' 33 const path = '/api/v1/videos/live'
27 34
28 return makePutBodyRequest({ 35 return makePutBodyRequest({
@@ -34,7 +41,7 @@ function updateLive (url: string, token: string, videoId: number | string, field
34 }) 41 })
35} 42}
36 43
37function createLive (url: string, token: string, fields: LiveVideoCreate, statusCodeExpected = 200) { 44function createLive (url: string, token: string, fields: LiveVideoCreate, statusCodeExpected = HttpStatusCode.OK_200) {
38 const path = '/api/v1/videos/live' 45 const path = '/api/v1/videos/live'
39 46
40 const attaches: any = {} 47 const attaches: any = {}