aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-07-27 17:00:39 +0200
committerRigel Kent <par@rigelk.eu>2020-07-29 18:15:53 +0200
commit7b3909644dd7cb8be1caad537bb40605e5f059d4 (patch)
tree499d23362c0532cd689624a35b98d8f51ba73ed4 /shared
parent225a7682e68d81c3c90ff50e704db4ab5f81a341 (diff)
downloadPeerTube-7b3909644dd7cb8be1caad537bb40605e5f059d4.tar.gz
PeerTube-7b3909644dd7cb8be1caad537bb40605e5f059d4.tar.zst
PeerTube-7b3909644dd7cb8be1caad537bb40605e5f059d4.zip
test search for subscriptions and video-channels
Diffstat (limited to 'shared')
-rw-r--r--shared/extra-utils/users/user-subscriptions.ts14
-rw-r--r--shared/extra-utils/videos/video-channels.ts6
2 files changed, 16 insertions, 4 deletions
diff --git a/shared/extra-utils/users/user-subscriptions.ts b/shared/extra-utils/users/user-subscriptions.ts
index 7148fbfca..6d402c073 100644
--- a/shared/extra-utils/users/user-subscriptions.ts
+++ b/shared/extra-utils/users/user-subscriptions.ts
@@ -12,7 +12,14 @@ function addUserSubscription (url: string, token: string, targetUri: string, sta
12 }) 12 })
13} 13}
14 14
15function listUserSubscriptions (url: string, token: string, sort = '-createdAt', statusCodeExpected = 200) { 15function listUserSubscriptions (parameters: {
16 url: string
17 token: string
18 sort?: string
19 search?: string
20 statusCodeExpected?: number
21}) {
22 const { url, token, sort = '-createdAt', search, statusCodeExpected = 200 } = parameters
16 const path = '/api/v1/users/me/subscriptions' 23 const path = '/api/v1/users/me/subscriptions'
17 24
18 return makeGetRequest({ 25 return makeGetRequest({
@@ -20,7 +27,10 @@ function listUserSubscriptions (url: string, token: string, sort = '-createdAt',
20 path, 27 path,
21 token, 28 token,
22 statusCodeExpected, 29 statusCodeExpected,
23 query: { sort } 30 query: {
31 sort,
32 search
33 }
24 }) 34 })
25} 35}
26 36
diff --git a/shared/extra-utils/videos/video-channels.ts b/shared/extra-utils/videos/video-channels.ts
index 55f08b996..97b68178f 100644
--- a/shared/extra-utils/videos/video-channels.ts
+++ b/shared/extra-utils/videos/video-channels.ts
@@ -32,8 +32,9 @@ function getAccountVideoChannelsList (parameters: {
32 sort?: string 32 sort?: string
33 specialStatus?: number 33 specialStatus?: number
34 withStats?: boolean 34 withStats?: boolean
35 search?: string
35}) { 36}) {
36 const { url, accountName, start, count, sort = 'createdAt', specialStatus = 200, withStats = false } = parameters 37 const { url, accountName, start, count, sort = 'createdAt', specialStatus = 200, withStats = false, search } = parameters
37 38
38 const path = '/api/v1/accounts/' + accountName + '/video-channels' 39 const path = '/api/v1/accounts/' + accountName + '/video-channels'
39 40
@@ -44,7 +45,8 @@ function getAccountVideoChannelsList (parameters: {
44 start, 45 start,
45 count, 46 count,
46 sort, 47 sort,
47 withStats 48 withStats,
49 search
48 }, 50 },
49 statusCodeExpected: specialStatus 51 statusCodeExpected: specialStatus
50 }) 52 })