aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/api
diff options
context:
space:
mode:
authorWolfboy248 <121288977+Wolfboy248@users.noreply.github.com>2024-09-06 13:05:39 +0200
committerWolfboy248 <121288977+Wolfboy248@users.noreply.github.com>2024-09-06 13:05:39 +0200
commitedff87fdf77b32fd03ee26892226068a53fbfaa6 (patch)
treede6ed2b1acf0c39421983bebe9737e8a615a950d /frontend/src/api
parentrefactor: maplist page (diff)
downloadlphub-edff87fdf77b32fd03ee26892226068a53fbfaa6.tar.gz
lphub-edff87fdf77b32fd03ee26892226068a53fbfaa6.tar.bz2
lphub-edff87fdf77b32fd03ee26892226068a53fbfaa6.zip
refactor: rankings page
Diffstat (limited to 'frontend/src/api')
-rw-r--r--frontend/src/api/Api.tsx8
1 files changed, 8 insertions, 0 deletions
diff --git a/frontend/src/api/Api.tsx b/frontend/src/api/Api.tsx
index 326052f..e62bb22 100644
--- a/frontend/src/api/Api.tsx
+++ b/frontend/src/api/Api.tsx
@@ -6,6 +6,7 @@ import { MapDiscussion, MapDiscussions, MapLeaderboard, MapSummary, Map } from '
6import { MapDiscussionCommentContent, MapDiscussionContent, ModMenuContent } from '../types/Content'; 6import { MapDiscussionCommentContent, MapDiscussionContent, ModMenuContent } from '../types/Content';
7import { Search } from '../types/Search'; 7import { Search } from '../types/Search';
8import { UserProfile } from '../types/Profile'; 8import { UserProfile } from '../types/Profile';
9import { Ranking } from '../types/Ranking';
9 10
10// add new api call function entries here 11// add new api call function entries here
11// example usage: API.get_games(); 12// example usage: API.get_games();
@@ -17,6 +18,7 @@ export const API = {
17 get_chapters: (chapter_id: string) => get_chapters(chapter_id), 18 get_chapters: (chapter_id: string) => get_chapters(chapter_id),
18 get_games_chapters: (game_id: string) => get_games_chapters(game_id), 19 get_games_chapters: (game_id: string) => get_games_chapters(game_id),
19 get_games_maps: (game_id: string) => get_games_maps(game_id), 20 get_games_maps: (game_id: string) => get_games_maps(game_id),
21 get_rankings: () => get_rankings(),
20 get_search: (q: string) => get_search(q), 22 get_search: (q: string) => get_search(q),
21 get_map_summary: (map_id: string) => get_map_summary(map_id), 23 get_map_summary: (map_id: string) => get_map_summary(map_id),
22 get_map_leaderboard: (map_id: string) => get_map_leaderboard(map_id), 24 get_map_leaderboard: (map_id: string) => get_map_leaderboard(map_id),
@@ -74,6 +76,12 @@ const get_games_maps = async (game_id: string): Promise<Map> => {
74 return response.data.data; 76 return response.data.data;
75} 77}
76 78
79// RANKINGS
80const get_rankings = async (): Promise<Ranking> => {
81 const response = await axios.get(url(`rankings`));
82 return response.data.data;
83}
84
77// SEARCH 85// SEARCH
78 86
79const get_search = async (q: string): Promise<Search> => { 87const get_search = async (q: string): Promise<Search> => {