2018-08-30 08:58:00 -04:00
|
|
|
import { makeGetRequest } from '../requests/requests'
|
2020-12-07 08:32:36 -05:00
|
|
|
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
|
2018-08-30 08:58:00 -04:00
|
|
|
|
2020-12-07 08:32:36 -05:00
|
|
|
function getVideosOverview (url: string, page: number, statusCodeExpected = HttpStatusCode.OK_200) {
|
2018-08-30 08:58:00 -04:00
|
|
|
const path = '/api/v1/overviews/videos'
|
|
|
|
|
2020-03-11 09:39:28 -04:00
|
|
|
const query = { page }
|
2018-08-30 08:58:00 -04:00
|
|
|
|
|
|
|
return makeGetRequest({
|
|
|
|
url,
|
|
|
|
path,
|
|
|
|
query,
|
2020-03-11 09:39:28 -04:00
|
|
|
statusCodeExpected
|
2018-08-30 08:58:00 -04:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2020-12-07 08:32:36 -05:00
|
|
|
function getVideosOverviewWithToken (url: string, page: number, token: string, statusCodeExpected = HttpStatusCode.OK_200) {
|
2020-03-11 09:39:28 -04:00
|
|
|
const path = '/api/v1/overviews/videos'
|
|
|
|
|
|
|
|
const query = { page }
|
|
|
|
|
|
|
|
return makeGetRequest({
|
|
|
|
url,
|
|
|
|
path,
|
|
|
|
query,
|
|
|
|
token,
|
|
|
|
statusCodeExpected
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export {
|
|
|
|
getVideosOverview,
|
|
|
|
getVideosOverviewWithToken
|
|
|
|
}
|