diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2024-11-04 13:47:50 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-04 13:47:50 +0300 |
| commit | eae19bb1b047b3568e7a9a624b50e80886e56331 (patch) | |
| tree | aa3215377fd1a7714e4c5763f9abf9d7dc7def2b /frontend/src/api | |
| parent | fix: remove insert trigger on users, check insert user on login err (#224) (diff) | |
| download | lphub-eae19bb1b047b3568e7a9a624b50e80886e56331.tar.gz lphub-eae19bb1b047b3568e7a9a624b50e80886e56331.tar.bz2 lphub-eae19bb1b047b3568e7a9a624b50e80886e56331.zip | |
feat/frontend: optimizing imports, file extensions (#230)
Co-authored-by: FifthWit <fifthwitbusiness@gmail.com>
Diffstat (limited to 'frontend/src/api')
| -rw-r--r-- | frontend/src/api/Api.ts (renamed from frontend/src/api/Api.tsx) | 16 | ||||
| -rw-r--r-- | frontend/src/api/Auth.ts (renamed from frontend/src/api/Auth.tsx) | 2 | ||||
| -rw-r--r-- | frontend/src/api/Games.ts (renamed from frontend/src/api/Games.tsx) | 10 | ||||
| -rw-r--r-- | frontend/src/api/Maps.ts (renamed from frontend/src/api/Maps.tsx) | 6 | ||||
| -rw-r--r-- | frontend/src/api/Mod.ts (renamed from frontend/src/api/Mod.tsx) | 4 | ||||
| -rw-r--r-- | frontend/src/api/Rankings.ts (renamed from frontend/src/api/Rankings.tsx) | 4 | ||||
| -rw-r--r-- | frontend/src/api/User.ts (renamed from frontend/src/api/User.tsx) | 4 |
7 files changed, 23 insertions, 23 deletions
diff --git a/frontend/src/api/Api.tsx b/frontend/src/api/Api.ts index 053e920..2e55ab4 100644 --- a/frontend/src/api/Api.tsx +++ b/frontend/src/api/Api.ts | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | import { MapDiscussionCommentContent, MapDiscussionContent, ModMenuContent } from '../types/Content'; | 1 | import { MapDiscussionCommentContent, MapDiscussionContent, ModMenuContent } from '@customTypes/Content'; |
| 2 | import { delete_token, get_token } from './Auth'; | 2 | import { delete_token, get_token } from '@api/Auth'; |
| 3 | import { get_user, get_profile, post_profile } from './User'; | 3 | import { get_user, get_profile, post_profile } from '@api/User'; |
| 4 | import { get_games, get_chapters, get_games_chapters, get_game_maps, get_search } from './Games'; | 4 | import { get_games, get_chapters, get_games_chapters, get_game_maps, get_search } from '@api/Games'; |
| 5 | import { get_official_rankings, get_unofficial_rankings } from './Rankings'; | 5 | import { get_official_rankings, get_unofficial_rankings } from '@api/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'; | 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 '@api/Maps'; |
| 7 | import { delete_map_summary, post_map_summary, put_map_image, put_map_summary } from './Mod'; | 7 | import { delete_map_summary, post_map_summary, put_map_image, put_map_summary } from '@api/Mod'; |
| 8 | import { UploadRunContent } from '../types/Content'; | 8 | import { UploadRunContent } from '@customTypes/Content'; |
| 9 | 9 | ||
| 10 | // add new api call function entries here | 10 | // add new api call function entries here |
| 11 | // example usage: API.get_games(); | 11 | // example usage: API.get_games(); |
diff --git a/frontend/src/api/Auth.tsx b/frontend/src/api/Auth.ts index 09269e6..875c7e5 100644 --- a/frontend/src/api/Auth.tsx +++ b/frontend/src/api/Auth.ts | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | import axios from "axios"; | 1 | import axios from "axios"; |
| 2 | import { url } from "./Api"; | 2 | import { url } from "@api/Api"; |
| 3 | 3 | ||
| 4 | export const get_token = async (): Promise<string | undefined> => { | 4 | export const get_token = async (): Promise<string | undefined> => { |
| 5 | const response = await axios.get(url(`token`)) | 5 | const response = await axios.get(url(`token`)) |
diff --git a/frontend/src/api/Games.tsx b/frontend/src/api/Games.ts index 84b5f74..72bb4b3 100644 --- a/frontend/src/api/Games.tsx +++ b/frontend/src/api/Games.ts | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | import axios from "axios"; | 1 | import axios from "axios"; |
| 2 | import { url } from "./Api"; | 2 | import { url } from "@api/Api"; |
| 3 | import { GameChapter, GamesChapters } from "../types/Chapters"; | 3 | import { GameChapter, GamesChapters } from "@customTypes/Chapters"; |
| 4 | import { Game } from "../types/Game"; | 4 | import { Game } from "@customTypes/Game"; |
| 5 | import { Map } from "../types/Map"; | 5 | import { Map } from "@customTypes/Map"; |
| 6 | import { Search } from "../types/Search"; | 6 | import { Search } from "@customTypes/Search"; |
| 7 | 7 | ||
| 8 | export const get_games = async (): Promise<Game[]> => { | 8 | export const get_games = async (): Promise<Game[]> => { |
| 9 | const response = await axios.get(url(`games`)) | 9 | const response = await axios.get(url(`games`)) |
diff --git a/frontend/src/api/Maps.tsx b/frontend/src/api/Maps.ts index fc50293..89657b5 100644 --- a/frontend/src/api/Maps.tsx +++ b/frontend/src/api/Maps.ts | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | import axios from "axios"; | 1 | import axios from "axios"; |
| 2 | import { url } from "./Api"; | 2 | import { url } from "@api/Api"; |
| 3 | import { MapDiscussionContent, UploadRunContent } from "../types/Content"; | 3 | import { MapDiscussionContent, UploadRunContent } from "@customTypes/Content"; |
| 4 | import { MapSummary, MapLeaderboard, MapDiscussions, MapDiscussion } from "../types/Map"; | 4 | import { MapSummary, MapLeaderboard, MapDiscussions, MapDiscussion } from "@customTypes/Map"; |
| 5 | 5 | ||
| 6 | export const get_map_summary = async (map_id: string): Promise<MapSummary> => { | 6 | export const get_map_summary = async (map_id: string): Promise<MapSummary> => { |
| 7 | const response = await axios.get(url(`maps/${map_id}/summary`)) | 7 | const response = await axios.get(url(`maps/${map_id}/summary`)) |
diff --git a/frontend/src/api/Mod.tsx b/frontend/src/api/Mod.ts index 9091379..1511f8b 100644 --- a/frontend/src/api/Mod.tsx +++ b/frontend/src/api/Mod.ts | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | import axios from "axios"; | 1 | import axios from "axios"; |
| 2 | import { url } from "./Api"; | 2 | import { url } from "@api/Api"; |
| 3 | import { ModMenuContent } from "../types/Content"; | 3 | import { ModMenuContent } from "@customTypes/Content"; |
| 4 | 4 | ||
| 5 | export const put_map_image = async (token: string, map_id: string, image: string): Promise<boolean> => { | 5 | export const put_map_image = async (token: string, map_id: string, image: string): Promise<boolean> => { |
| 6 | const response = await axios.put(url(`maps/${map_id}/image`), { | 6 | const response = await axios.put(url(`maps/${map_id}/image`), { |
diff --git a/frontend/src/api/Rankings.tsx b/frontend/src/api/Rankings.ts index 384f826..b8d9bec 100644 --- a/frontend/src/api/Rankings.tsx +++ b/frontend/src/api/Rankings.ts | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | import axios from "axios"; | 1 | import axios from "axios"; |
| 2 | import { url } from "./Api"; | 2 | import { url } from "@api/Api"; |
| 3 | import { Ranking, SteamRanking } from "../types/Ranking"; | 3 | import { Ranking, SteamRanking } from "@customTypes/Ranking"; |
| 4 | 4 | ||
| 5 | export const get_official_rankings = async (): Promise<Ranking> => { | 5 | export const get_official_rankings = async (): Promise<Ranking> => { |
| 6 | const response = await axios.get(url(`rankings/lphub`)); | 6 | const response = await axios.get(url(`rankings/lphub`)); |
diff --git a/frontend/src/api/User.tsx b/frontend/src/api/User.ts index c4d1944..88da0f2 100644 --- a/frontend/src/api/User.tsx +++ b/frontend/src/api/User.ts | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | import axios from "axios"; | 1 | import axios from "axios"; |
| 2 | import { url } from "./Api"; | 2 | import { url } from "@api/Api"; |
| 3 | import { UserProfile } from "../types/Profile"; | 3 | import { UserProfile } from "@customTypes/Profile"; |
| 4 | 4 | ||
| 5 | export const get_user = async (user_id: string): Promise<UserProfile> => { | 5 | export const get_user = async (user_id: string): Promise<UserProfile> => { |
| 6 | const response = await axios.get(url(`users/${user_id}`)); | 6 | const response = await axios.get(url(`users/${user_id}`)); |