Implement pagination for overviews endpoint

This commit is contained in:
Chocobozzz
2020-03-11 14:39:28 +01:00
parent fab6746354
commit 764a965778
9 changed files with 227 additions and 91 deletions

View File

@@ -1,18 +1,33 @@
import { makeGetRequest } from '../requests/requests'
function getVideosOverview (url: string, useCache = false) {
function getVideosOverview (url: string, page: number, statusCodeExpected = 200) {
const path = '/api/v1/overviews/videos'
const query = {
t: useCache ? undefined : new Date().getTime()
}
const query = { page }
return makeGetRequest({
url,
path,
query,
statusCodeExpected: 200
statusCodeExpected
})
}
export { getVideosOverview }
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
}