]>
Commit | Line | Data |
---|---|---|
1 | import { makeGetRequest } from '../requests/requests' | |
2 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | |
3 | ||
4 | function getVideosOverview (url: string, page: number, statusCodeExpected = HttpStatusCode.OK_200) { | |
5 | const path = '/api/v1/overviews/videos' | |
6 | ||
7 | const query = { page } | |
8 | ||
9 | return makeGetRequest({ | |
10 | url, | |
11 | path, | |
12 | query, | |
13 | statusCodeExpected | |
14 | }) | |
15 | } | |
16 | ||
17 | function getVideosOverviewWithToken (url: string, page: number, token: string, statusCodeExpected = HttpStatusCode.OK_200) { | |
18 | const path = '/api/v1/overviews/videos' | |
19 | ||
20 | const query = { page } | |
21 | ||
22 | return makeGetRequest({ | |
23 | url, | |
24 | path, | |
25 | query, | |
26 | token, | |
27 | statusCodeExpected | |
28 | }) | |
29 | } | |
30 | ||
31 | export { | |
32 | getVideosOverview, | |
33 | getVideosOverviewWithToken | |
34 | } |