diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2025-10-26 13:51:31 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-26 12:51:31 +0300 |
| commit | 6a631744d9c80ff9a1a9f4b278bc0337ecdb494e (patch) | |
| tree | 3acf1f505751d997b1b7482823eacabcb79a03f3 /frontend/src/api | |
| parent | fix/frontend: tablet view logout button (#286) (diff) | |
| download | lphub-6a631744d9c80ff9a1a9f4b278bc0337ecdb494e.tar.gz lphub-6a631744d9c80ff9a1a9f4b278bc0337ecdb494e.tar.bz2 lphub-6a631744d9c80ff9a1a9f4b278bc0337ecdb494e.zip | |
chore/frontend: semicolon linting (#287)
Diffstat (limited to 'frontend/src/api')
| -rw-r--r-- | frontend/src/api/Api.ts | 2 | ||||
| -rw-r--r-- | frontend/src/api/Auth.ts | 2 | ||||
| -rw-r--r-- | frontend/src/api/Games.ts | 8 | ||||
| -rw-r--r-- | frontend/src/api/Maps.ts | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/frontend/src/api/Api.ts b/frontend/src/api/Api.ts index 19ece86..dd5076a 100644 --- a/frontend/src/api/Api.ts +++ b/frontend/src/api/Api.ts | |||
| @@ -51,7 +51,7 @@ export const API = { | |||
| 51 | 51 | ||
| 52 | const BASE_API_URL: string = import.meta.env.DEV | 52 | const BASE_API_URL: string = import.meta.env.DEV |
| 53 | ? "https://lp.portal2.sr/api/v1/" | 53 | ? "https://lp.portal2.sr/api/v1/" |
| 54 | : "/api/v1/" | 54 | : "/api/v1/"; |
| 55 | 55 | ||
| 56 | export function url(path: string): string { | 56 | export function url(path: string): string { |
| 57 | return BASE_API_URL + path; | 57 | return BASE_API_URL + path; |
diff --git a/frontend/src/api/Auth.ts b/frontend/src/api/Auth.ts index 56e0f6a..426bea5 100644 --- a/frontend/src/api/Auth.ts +++ b/frontend/src/api/Auth.ts | |||
| @@ -2,7 +2,7 @@ import axios from "axios"; | |||
| 2 | import { url } from "@api/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")); |
| 6 | if (!response.data.success) { | 6 | if (!response.data.success) { |
| 7 | return undefined; | 7 | return undefined; |
| 8 | } | 8 | } |
diff --git a/frontend/src/api/Games.ts b/frontend/src/api/Games.ts index 98c65e7..a66902d 100644 --- a/frontend/src/api/Games.ts +++ b/frontend/src/api/Games.ts | |||
| @@ -6,14 +6,14 @@ import { Map } from "@customTypes/Map"; | |||
| 6 | import { Search } from "@customTypes/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")); |
| 10 | return response.data.data; | 10 | return response.data.data; |
| 11 | }; | 11 | }; |
| 12 | 12 | ||
| 13 | export const get_chapters = async (chapter_id: string): Promise<GameChapter> => { | 13 | export const get_chapters = async (chapter_id: string): Promise<GameChapter> => { |
| 14 | const response = await axios.get(url(`chapters/${chapter_id}`)); | 14 | const response = await axios.get(url(`chapters/${chapter_id}`)); |
| 15 | return response.data.data; | 15 | return response.data.data; |
| 16 | } | 16 | }; |
| 17 | 17 | ||
| 18 | export const get_games_chapters = async (game_id: string): Promise<GamesChapters> => { | 18 | export const get_games_chapters = async (game_id: string): Promise<GamesChapters> => { |
| 19 | const response = await axios.get(url(`games/${game_id}`)); | 19 | const response = await axios.get(url(`games/${game_id}`)); |
| @@ -21,11 +21,11 @@ export const get_games_chapters = async (game_id: string): Promise<GamesChapters | |||
| 21 | }; | 21 | }; |
| 22 | 22 | ||
| 23 | export const get_game_maps = async (game_id: string): Promise<Map[]> => { | 23 | export const get_game_maps = async (game_id: string): Promise<Map[]> => { |
| 24 | const response = await axios.get(url(`games/${game_id}/maps`)) | 24 | const response = await axios.get(url(`games/${game_id}/maps`)); |
| 25 | return response.data.data.maps; | 25 | return response.data.data.maps; |
| 26 | }; | 26 | }; |
| 27 | 27 | ||
| 28 | export const get_search = async (q: string): Promise<Search> => { | 28 | export const get_search = async (q: string): Promise<Search> => { |
| 29 | const response = await axios.get(url(`search?q=${q}`)) | 29 | const response = await axios.get(url(`search?q=${q}`)); |
| 30 | return response.data.data; | 30 | return response.data.data; |
| 31 | }; | 31 | }; |
diff --git a/frontend/src/api/Maps.ts b/frontend/src/api/Maps.ts index 8d29f84..7cbd70c 100644 --- a/frontend/src/api/Maps.ts +++ b/frontend/src/api/Maps.ts | |||
| @@ -4,7 +4,7 @@ import { MapDiscussionContent, UploadRunContent } from "@customTypes/Content"; | |||
| 4 | import { MapSummary, MapLeaderboard, MapDiscussions, MapDiscussion } from "@customTypes/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`)); |
| 8 | return response.data.data; | 8 | return response.data.data; |
| 9 | }; | 9 | }; |
| 10 | 10 | ||
| @@ -94,7 +94,7 @@ export const post_record = async (token: string, run: UploadRunContent, map_id: | |||
| 94 | }); | 94 | }); |
| 95 | return [response.data.success, response.data.message]; | 95 | return [response.data.success, response.data.message]; |
| 96 | } | 96 | } |
| 97 | } | 97 | }; |
| 98 | 98 | ||
| 99 | export const delete_map_record = async (token: string, map_id: number, record_id: number): Promise<boolean> => { | 99 | export const delete_map_record = async (token: string, map_id: number, record_id: number): Promise<boolean> => { |
| 100 | const response = await axios.delete(url(`maps/${map_id}/record/${record_id}`), { | 100 | const response = await axios.delete(url(`maps/${map_id}/record/${record_id}`), { |