From edff87fdf77b32fd03ee26892226068a53fbfaa6 Mon Sep 17 00:00:00 2001
From: Wolfboy248 <121288977+Wolfboy248@users.noreply.github.com>
Date: Fri, 6 Sep 2024 13:05:39 +0200
Subject: refactor: rankings page

---
 frontend/src/api/Api.tsx | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'frontend/src/api/Api.tsx')

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 '
 import { MapDiscussionCommentContent, MapDiscussionContent, ModMenuContent } from '../types/Content';
 import { Search } from '../types/Search';
 import { UserProfile } from '../types/Profile';
+import { Ranking } from '../types/Ranking';
 
 // add new api call function entries here
 // example usage: API.get_games();
@@ -17,6 +18,7 @@ export const API = {
   get_chapters: (chapter_id: string) => get_chapters(chapter_id),
   get_games_chapters: (game_id: string) => get_games_chapters(game_id),
   get_games_maps: (game_id: string) => get_games_maps(game_id),
+  get_rankings: () => get_rankings(),
   get_search: (q: string) => get_search(q),
   get_map_summary: (map_id: string) => get_map_summary(map_id),
   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> => {
   return response.data.data;
 }
 
+// RANKINGS
+const get_rankings = async (): Promise<Ranking> => {
+  const response = await axios.get(url(`rankings`));
+  return response.data.data;
+}
+
 // SEARCH
 
 const get_search = async (q: string): Promise<Search> => {
-- 
cgit v1.2.3

