aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-21 10:34:18 +0200
committerChocobozzz <me@florianbigard.com>2018-08-27 09:41:54 +0200
commit99492dbc0d87ef54d0dab7d8d44f8d0de5722bdd (patch)
treee442f6cdf0cb622cb78f64d0d9de23bfb6deb951 /server/tests/utils
parent8a19bee1a1ee39f973bb37429e4f73c3f2873cdb (diff)
downloadPeerTube-99492dbc0d87ef54d0dab7d8d44f8d0de5722bdd.tar.gz
PeerTube-99492dbc0d87ef54d0dab7d8d44f8d0de5722bdd.tar.zst
PeerTube-99492dbc0d87ef54d0dab7d8d44f8d0de5722bdd.zip
Add get subscription endpoint
Diffstat (limited to 'server/tests/utils')
-rw-r--r--server/tests/utils/users/user-subscriptions.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/server/tests/utils/users/user-subscriptions.ts b/server/tests/utils/users/user-subscriptions.ts
index 323e5de58..852f590cf 100644
--- a/server/tests/utils/users/user-subscriptions.ts
+++ b/server/tests/utils/users/user-subscriptions.ts
@@ -36,6 +36,17 @@ function listUserSubscriptionVideos (url: string, token: string, sort = '-create
36 }) 36 })
37} 37}
38 38
39function getUserSubscription (url: string, token: string, uri: string, statusCodeExpected = 200) {
40 const path = '/api/v1/users/me/subscriptions/' + uri
41
42 return makeGetRequest({
43 url,
44 path,
45 token,
46 statusCodeExpected
47 })
48}
49
39function removeUserSubscription (url: string, token: string, uri: string, statusCodeExpected = 204) { 50function removeUserSubscription (url: string, token: string, uri: string, statusCodeExpected = 204) {
40 const path = '/api/v1/users/me/subscriptions/' + uri 51 const path = '/api/v1/users/me/subscriptions/' + uri
41 52
@@ -52,6 +63,7 @@ function removeUserSubscription (url: string, token: string, uri: string, status
52export { 63export {
53 addUserSubscription, 64 addUserSubscription,
54 listUserSubscriptions, 65 listUserSubscriptions,
66 getUserSubscription,
55 listUserSubscriptionVideos, 67 listUserSubscriptionVideos,
56 removeUserSubscription 68 removeUserSubscription
57} 69}