]>
Commit | Line | Data |
---|---|---|
2d3741d6 | 1 | import { makeGetRequest } from '../requests/requests' |
2d53be02 | 2 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' |
2d3741d6 | 3 | |
2d53be02 | 4 | function getVideosOverview (url: string, page: number, statusCodeExpected = HttpStatusCode.OK_200) { |
2d3741d6 C |
5 | const path = '/api/v1/overviews/videos' |
6 | ||
764a9657 | 7 | const query = { page } |
2d3741d6 C |
8 | |
9 | return makeGetRequest({ | |
10 | url, | |
11 | path, | |
12 | query, | |
764a9657 | 13 | statusCodeExpected |
2d3741d6 C |
14 | }) |
15 | } | |
16 | ||
2d53be02 | 17 | function getVideosOverviewWithToken (url: string, page: number, token: string, statusCodeExpected = HttpStatusCode.OK_200) { |
764a9657 C |
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 | } |