overviews.ts 748 B

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