2020-06-10 04:58:44 -04:00
|
|
|
import { VideoChannelsSearchQuery } from '@shared/models'
|
2018-08-24 05:04:02 -04:00
|
|
|
import { makeGetRequest } from '../requests/requests'
|
|
|
|
|
|
|
|
function searchVideoChannel (url: string, search: string, token?: string, statusCodeExpected = 200) {
|
|
|
|
const path = '/api/v1/search/video-channels'
|
|
|
|
|
|
|
|
return makeGetRequest({
|
|
|
|
url,
|
|
|
|
path,
|
|
|
|
query: {
|
|
|
|
sort: '-createdAt',
|
|
|
|
search
|
|
|
|
},
|
|
|
|
token,
|
|
|
|
statusCodeExpected
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2020-06-10 04:58:44 -04:00
|
|
|
function advancedVideoChannelSearch (url: string, search: VideoChannelsSearchQuery) {
|
|
|
|
const path = '/api/v1/search/video-channels'
|
|
|
|
|
|
|
|
return makeGetRequest({
|
|
|
|
url,
|
|
|
|
path,
|
|
|
|
query: search,
|
|
|
|
statusCodeExpected: 200
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2018-08-24 05:04:02 -04:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
export {
|
2020-06-10 04:58:44 -04:00
|
|
|
searchVideoChannel,
|
|
|
|
advancedVideoChannelSearch
|
2018-08-24 05:04:02 -04:00
|
|
|
}
|