aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils')
-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 })