api.ts 754 B

123456789101112131415161718192021222324252627
  1. import { AxiosError } from 'axios';
  2. export enum API_ROUTE {
  3. USER = 'user',
  4. REGIONS = 'regions',
  5. SERIES = 'series'
  6. }
  7. export enum API_ENDPOINT {
  8. LOGIN = 'login',
  9. REGISTER = 'join',
  10. RESET_PASSWORD = 'recover-password',
  11. GET_REGIONS = 'get-regions',
  12. JOIN_TEST = 'pre-join-test',
  13. SERIES = 'get-for-regions'
  14. }
  15. export enum API {
  16. LOGIN = `${API_ROUTE.USER}/${API_ENDPOINT.LOGIN}`,
  17. REGISTER = `${API_ROUTE.USER}/${API_ENDPOINT.REGISTER}`,
  18. RESET_PASSWORD = `${API_ROUTE.USER}/${API_ENDPOINT.RESET_PASSWORD}`,
  19. GET_REGIONS = `${API_ROUTE.REGIONS}/${API_ENDPOINT.GET_REGIONS}`,
  20. JOIN_TEST = `${API_ROUTE.USER}/${API_ENDPOINT.JOIN_TEST}`,
  21. SERIES = `${API_ROUTE.SERIES}/${API_ENDPOINT.SERIES}`
  22. }
  23. export type BaseAxiosError = AxiosError;