diff options
Diffstat (limited to 'frontend/src/api/Api.tsx')
| -rw-r--r-- | frontend/src/api/Api.tsx | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/frontend/src/api/Api.tsx b/frontend/src/api/Api.tsx deleted file mode 100644 index 053e920..0000000 --- a/frontend/src/api/Api.tsx +++ /dev/null | |||
| @@ -1,56 +0,0 @@ | |||
| 1 | import { MapDiscussionCommentContent, MapDiscussionContent, ModMenuContent } from '../types/Content'; | ||
| 2 | import { delete_token, get_token } from './Auth'; | ||
| 3 | import { get_user, get_profile, post_profile } from './User'; | ||
| 4 | import { get_games, get_chapters, get_games_chapters, get_game_maps, get_search } from './Games'; | ||
| 5 | import { get_official_rankings, get_unofficial_rankings } from './Rankings'; | ||
| 6 | import { get_map_summary, get_map_leaderboard, get_map_discussions, get_map_discussion, post_map_discussion, post_map_discussion_comment, delete_map_discussion, post_record, delete_map_record } from './Maps'; | ||
| 7 | import { delete_map_summary, post_map_summary, put_map_image, put_map_summary } from './Mod'; | ||
| 8 | import { UploadRunContent } from '../types/Content'; | ||
| 9 | |||
| 10 | // add new api call function entries here | ||
| 11 | // example usage: API.get_games(); | ||
| 12 | export const API = { | ||
| 13 | // Auth | ||
| 14 | get_token: () => get_token(), | ||
| 15 | |||
| 16 | delete_token: () => delete_token(), | ||
| 17 | // User | ||
| 18 | get_user: (user_id: string) => get_user(user_id), | ||
| 19 | get_profile: (token: string) => get_profile(token), | ||
| 20 | post_profile: (token: string) => post_profile(token), | ||
| 21 | // Games | ||
| 22 | get_games: () => get_games(), | ||
| 23 | get_chapters: (chapter_id: string) => get_chapters(chapter_id), | ||
| 24 | get_games_chapters: (game_id: string) => get_games_chapters(game_id), | ||
| 25 | get_game_maps: (game_id: string) => get_game_maps(game_id), | ||
| 26 | get_search: (q: string) => get_search(q), | ||
| 27 | // Rankings | ||
| 28 | get_official_rankings: () => get_official_rankings(), | ||
| 29 | get_unofficial_rankings: () => get_unofficial_rankings(), | ||
| 30 | // Maps | ||
| 31 | get_map_summary: (map_id: string) => get_map_summary(map_id), | ||
| 32 | get_map_leaderboard: (map_id: string) => get_map_leaderboard(map_id), | ||
| 33 | get_map_discussions: (map_id: string) => get_map_discussions(map_id), | ||
| 34 | get_map_discussion: (map_id: string, discussion_id: number) => get_map_discussion(map_id, discussion_id), | ||
| 35 | |||
| 36 | post_map_discussion: (token: string, map_id: string, content: MapDiscussionContent) => post_map_discussion(token, map_id, content), | ||
| 37 | post_map_discussion_comment: (token: string, map_id: string, discussion_id: number, comment: string) => post_map_discussion_comment(token, map_id, discussion_id, comment), | ||
| 38 | post_record: (token: string, run: UploadRunContent) => post_record(token, run), | ||
| 39 | |||
| 40 | delete_map_discussion: (token: string, map_id: string, discussion_id: number) => delete_map_discussion(token, map_id, discussion_id), | ||
| 41 | |||
| 42 | delete_map_record: (token: string, map_id: number, record_id: number) => delete_map_record(token, map_id, record_id), | ||
| 43 | // Mod | ||
| 44 | post_map_summary: (token: string, map_id: string, content: ModMenuContent) => post_map_summary(token, map_id, content), | ||
| 45 | |||
| 46 | put_map_image: (token: string, map_id: string, image: string) => put_map_image(token, map_id, image), | ||
| 47 | put_map_summary: (token: string, map_id: string, content: ModMenuContent) => put_map_summary(token, map_id, content), | ||
| 48 | |||
| 49 | delete_map_summary: (token: string, map_id: string, route_id: number) => delete_map_summary(token, map_id, route_id), | ||
| 50 | }; | ||
| 51 | |||
| 52 | const BASE_API_URL: string = "/api/v1/" | ||
| 53 | |||
| 54 | export function url(path: string): string { | ||
| 55 | return BASE_API_URL + path; | ||
| 56 | }; | ||