aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/users
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/users')
-rw-r--r--shared/extra-utils/users/user-subscriptions.ts14
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
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