mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Implement pagination for overviews endpoint
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user