aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/overviews
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/overviews')
-rw-r--r--shared/extra-utils/overviews/overviews.ts27
1 files changed, 21 insertions, 6 deletions
diff --git a/shared/extra-utils/overviews/overviews.ts b/shared/extra-utils/overviews/overviews.ts
index 23e3ceb1e..ae4d31aa3 100644
--- a/shared/extra-utils/overviews/overviews.ts
+++ b/shared/extra-utils/overviews/overviews.ts
@@ -1,18 +1,33 @@
1import { makeGetRequest } from '../requests/requests' 1import { makeGetRequest } from '../requests/requests'
2 2
3function getVideosOverview (url: string, useCache = false) { 3function getVideosOverview (url: string, page: number, statusCodeExpected = 200) {
4 const path = '/api/v1/overviews/videos' 4 const path = '/api/v1/overviews/videos'
5 5
6 const query = { 6 const query = { page }
7 t: useCache ? undefined : new Date().getTime()
8 }
9 7
10 return makeGetRequest({ 8 return makeGetRequest({
11 url, 9 url,
12 path, 10 path,
13 query, 11 query,
14 statusCodeExpected: 200 12 statusCodeExpected
15 }) 13 })
16} 14}
17 15
18export { getVideosOverview } 16function getVideosOverviewWithToken (url: string, page: number, token: string, statusCodeExpected = 200) {
17 const path = '/api/v1/overviews/videos'
18
19 const query = { page }
20
21 return makeGetRequest({
22 url,
23 path,
24 query,
25 token,
26 statusCodeExpected
27 })
28}
29
30export {
31 getVideosOverview,
32 getVideosOverviewWithToken
33}