diff options
author | Chocobozzz <me@florianbigard.com> | 2018-04-25 16:15:39 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-04-25 16:16:21 +0200 |
commit | cc918ac3f45e32f031cce7b6e0473e5c2c34b8ae (patch) | |
tree | 034c0ce9cda37d572fe1c0c34eff750681e18574 /server/tests/utils/videos/video-channels.ts | |
parent | d3e91a5f72ac9c986cdb67d7d6c85bb4819e680c (diff) | |
download | PeerTube-cc918ac3f45e32f031cce7b6e0473e5c2c34b8ae.tar.gz PeerTube-cc918ac3f45e32f031cce7b6e0473e5c2c34b8ae.tar.zst PeerTube-cc918ac3f45e32f031cce7b6e0473e5c2c34b8ae.zip |
Update video-channel routes (again)
Use /video-channels now, it's more simple for clients
Diffstat (limited to 'server/tests/utils/videos/video-channels.ts')
-rw-r--r-- | server/tests/utils/videos/video-channels.ts | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/server/tests/utils/videos/video-channels.ts b/server/tests/utils/videos/video-channels.ts index 0b4fa89b7..978e21b19 100644 --- a/server/tests/utils/videos/video-channels.ts +++ b/server/tests/utils/videos/video-channels.ts | |||
@@ -34,11 +34,10 @@ function getAccountVideoChannelsList (url: string, accountId: number | string, s | |||
34 | function addVideoChannel ( | 34 | function addVideoChannel ( |
35 | url: string, | 35 | url: string, |
36 | token: string, | 36 | token: string, |
37 | accountId: number | string, | ||
38 | videoChannelAttributesArg: VideoChannelAttributes, | 37 | videoChannelAttributesArg: VideoChannelAttributes, |
39 | expectedStatus = 200 | 38 | expectedStatus = 200 |
40 | ) { | 39 | ) { |
41 | const path = '/api/v1/accounts/' + accountId + '/video-channels/' | 40 | const path = '/api/v1/video-channels/' |
42 | 41 | ||
43 | // Default attributes | 42 | // Default attributes |
44 | let attributes = { | 43 | let attributes = { |
@@ -59,13 +58,12 @@ function addVideoChannel ( | |||
59 | function updateVideoChannel ( | 58 | function updateVideoChannel ( |
60 | url: string, | 59 | url: string, |
61 | token: string, | 60 | token: string, |
62 | accountId: number | string, | ||
63 | channelId: number | string, | 61 | channelId: number | string, |
64 | attributes: VideoChannelAttributes, | 62 | attributes: VideoChannelAttributes, |
65 | expectedStatus = 204 | 63 | expectedStatus = 204 |
66 | ) { | 64 | ) { |
67 | const body = {} | 65 | const body = {} |
68 | const path = '/api/v1/accounts/' + accountId + '/video-channels/' + channelId | 66 | const path = '/api/v1/video-channels/' + channelId |
69 | 67 | ||
70 | if (attributes.name) body['name'] = attributes.name | 68 | if (attributes.name) body['name'] = attributes.name |
71 | if (attributes.description) body['description'] = attributes.description | 69 | if (attributes.description) body['description'] = attributes.description |
@@ -79,8 +77,8 @@ function updateVideoChannel ( | |||
79 | .expect(expectedStatus) | 77 | .expect(expectedStatus) |
80 | } | 78 | } |
81 | 79 | ||
82 | function deleteVideoChannel (url: string, token: string, accountId: number | string, channelId: number | string, expectedStatus = 204) { | 80 | function deleteVideoChannel (url: string, token: string, channelId: number | string, expectedStatus = 204) { |
83 | const path = '/api/v1/accounts/' + accountId + '/video-channels/' + channelId | 81 | const path = '/api/v1/video-channels/' + channelId |
84 | 82 | ||
85 | return request(url) | 83 | return request(url) |
86 | .delete(path) | 84 | .delete(path) |
@@ -89,8 +87,8 @@ function deleteVideoChannel (url: string, token: string, accountId: number | str | |||
89 | .expect(expectedStatus) | 87 | .expect(expectedStatus) |
90 | } | 88 | } |
91 | 89 | ||
92 | function getVideoChannel (url: string, accountId: number | string, channelId: number | string) { | 90 | function getVideoChannel (url: string, channelId: number | string) { |
93 | const path = '/api/v1/accounts/' + accountId + '/video-channels/' + channelId | 91 | const path = '/api/v1/video-channels/' + channelId |
94 | 92 | ||
95 | return request(url) | 93 | return request(url) |
96 | .get(path) | 94 | .get(path) |