test search for subscriptions and video-channels

This commit is contained in:
Rigel Kent
2020-07-27 17:00:39 +02:00
committed by Rigel Kent
parent 225a7682e6
commit 7b3909644d
7 changed files with 77 additions and 10 deletions

View File

@@ -12,7 +12,14 @@ function addUserSubscription (url: string, token: string, targetUri: string, sta
})
}
function listUserSubscriptions (url: string, token: string, sort = '-createdAt', statusCodeExpected = 200) {
function listUserSubscriptions (parameters: {
url: string
token: string
sort?: string
search?: string
statusCodeExpected?: number
}) {
const { url, token, sort = '-createdAt', search, statusCodeExpected = 200 } = parameters
const path = '/api/v1/users/me/subscriptions'
return makeGetRequest({
@@ -20,7 +27,10 @@ function listUserSubscriptions (url: string, token: string, sort = '-createdAt',
path,
token,
statusCodeExpected,
query: { sort }
query: {
sort,
search
}
})
}

View File

@@ -32,8 +32,9 @@ function getAccountVideoChannelsList (parameters: {
sort?: string
specialStatus?: number
withStats?: boolean
search?: string
}) {
const { url, accountName, start, count, sort = 'createdAt', specialStatus = 200, withStats = false } = parameters
const { url, accountName, start, count, sort = 'createdAt', specialStatus = 200, withStats = false, search } = parameters
const path = '/api/v1/accounts/' + accountName + '/video-channels'
@@ -44,7 +45,8 @@ function getAccountVideoChannelsList (parameters: {
start,
count,
sort,
withStats
withStats,
search
},
statusCodeExpected: specialStatus
})