PeerTube/shared/extra-utils/overviews/overviews.ts

34 lines
629 B
TypeScript
Raw Normal View History

2018-08-30 07:58:00 -05:00
import { makeGetRequest } from '../requests/requests'
function getVideosOverview (url: string, page: number, statusCodeExpected = 200) {
2018-08-30 07:58:00 -05:00
const path = '/api/v1/overviews/videos'
const query = { page }
2018-08-30 07:58:00 -05:00
return makeGetRequest({
url,
path,
query,
statusCodeExpected
2018-08-30 07:58:00 -05:00
})
}
function getVideosOverviewWithToken (url: string, page: number, token: string, statusCodeExpected = 200) {
const path = '/api/v1/overviews/videos'
const query = { page }
return makeGetRequest({
url,
path,
query,
token,
statusCodeExpected
})
}
export {
getVideosOverview,
getVideosOverviewWithToken
}