From 89560a61bc6e41d86acaea596762eda2da38fe50 Mon Sep 17 00:00:00 2001
From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>
Date: Mon, 9 Sep 2024 19:29:42 +0300
Subject: refactor: upload run form, lots of random shit

---
 frontend/src/api/Api.tsx | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

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

diff --git a/frontend/src/api/Api.tsx b/frontend/src/api/Api.tsx
index e62bb22..1f77088 100644
--- a/frontend/src/api/Api.tsx
+++ b/frontend/src/api/Api.tsx
@@ -1,8 +1,8 @@
 import axios from 'axios';
 
-import { Game, GameChapters } from '../types/Game';
 import { GameChapter, GamesChapters } from '../types/Chapters';
-import { MapDiscussion, MapDiscussions, MapLeaderboard, MapSummary, Map } from '../types/Map';
+import { Game } from '../types/Game';
+import { Map, MapDiscussion, MapDiscussions, MapLeaderboard, MapSummary } from '../types/Map';
 import { MapDiscussionCommentContent, MapDiscussionContent, ModMenuContent } from '../types/Content';
 import { Search } from '../types/Search';
 import { UserProfile } from '../types/Profile';
@@ -15,11 +15,13 @@ export const API = {
 
   get_user: (user_id: string) => get_user(user_id),
   get_games: () => get_games(),
+
   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_game_maps: (game_id: string) => get_game_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),
   get_map_discussions: (map_id: string) => get_map_discussions(map_id),
@@ -71,10 +73,11 @@ const get_games_chapters = async (game_id: string): Promise<GamesChapters> => {
   return response.data.data;
 };
 
-const get_games_maps = async (game_id: string): Promise<Map> => {
+const get_game_maps = async (game_id: string): Promise<Map[]> => {
   const response = await axios.get(url(`games/${game_id}/maps`))
-  return response.data.data;
-}
+  return response.data.data.maps;
+};
+
 
 // RANKINGS
 const get_rankings = async (): Promise<Ranking> => {
-- 
cgit v1.2.3

