diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-07-27 17:00:39 +0200 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2020-07-29 18:15:53 +0200 |
commit | 7b3909644dd7cb8be1caad537bb40605e5f059d4 (patch) | |
tree | 499d23362c0532cd689624a35b98d8f51ba73ed4 /shared/extra-utils/users/user-subscriptions.ts | |
parent | 225a7682e68d81c3c90ff50e704db4ab5f81a341 (diff) | |
download | PeerTube-7b3909644dd7cb8be1caad537bb40605e5f059d4.tar.gz PeerTube-7b3909644dd7cb8be1caad537bb40605e5f059d4.tar.zst PeerTube-7b3909644dd7cb8be1caad537bb40605e5f059d4.zip |
test search for subscriptions and video-channels
Diffstat (limited to 'shared/extra-utils/users/user-subscriptions.ts')
-rw-r--r-- | shared/extra-utils/users/user-subscriptions.ts | 14 |
1 files changed, 12 insertions, 2 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 | ||
15 | function listUserSubscriptions (url: string, token: string, sort = '-createdAt', statusCodeExpected = 200) { | 15 | function 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 | ||