aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/api
diff options
context:
space:
mode:
authorFifthWit <fifthwitbusiness@gmail.com>2025-01-30 13:11:48 -0600
committerFifthWit <fifthwitbusiness@gmail.com>2025-01-30 13:11:48 -0600
commit81342e2579165ebfdb28c749dc5225141721a419 (patch)
tree8e5759c20b92408048fe5ac44f48e2df2a00ab9b /frontend/src/api
parentfixed issues with useCallback (diff)
downloadlphub-81342e2579165ebfdb28c749dc5225141721a419.tar.gz
lphub-81342e2579165ebfdb28c749dc5225141721a419.tar.bz2
lphub-81342e2579165ebfdb28c749dc5225141721a419.zip
switched to double quotes
Diffstat (limited to 'frontend/src/api')
-rw-r--r--frontend/src/api/Api.ts18
-rw-r--r--frontend/src/api/Auth.ts6
-rw-r--r--frontend/src/api/Games.ts12
-rw-r--r--frontend/src/api/Maps.ts12
-rw-r--r--frontend/src/api/Mod.ts6
-rw-r--r--frontend/src/api/Rankings.ts6
-rw-r--r--frontend/src/api/User.ts6
7 files changed, 33 insertions, 33 deletions
diff --git a/frontend/src/api/Api.ts b/frontend/src/api/Api.ts
index b98dda3..0e1658c 100644
--- a/frontend/src/api/Api.ts
+++ b/frontend/src/api/Api.ts
@@ -1,14 +1,14 @@
1import { MapDiscussionContent, ModMenuContent } from '@customTypes/Content'; 1import { MapDiscussionContent, ModMenuContent } from "@customTypes/Content";
2import { delete_token, get_token } from '@api/Auth'; 2import { delete_token, get_token } from "@api/Auth";
3import { get_user, get_profile, post_profile } from '@api/User'; 3import { get_user, get_profile, post_profile } from "@api/User";
4import { 4import {
5 get_games, 5 get_games,
6 get_chapters, 6 get_chapters,
7 get_games_chapters, 7 get_games_chapters,
8 get_game_maps, 8 get_game_maps,
9 get_search, 9 get_search,
10} from '@api/Games'; 10} from "@api/Games";
11import { get_official_rankings, get_unofficial_rankings } from '@api/Rankings'; 11import { get_official_rankings, get_unofficial_rankings } from "@api/Rankings";
12import { 12import {
13 get_map_summary, 13 get_map_summary,
14 get_map_leaderboard, 14 get_map_leaderboard,
@@ -19,14 +19,14 @@ import {
19 delete_map_discussion, 19 delete_map_discussion,
20 post_record, 20 post_record,
21 delete_map_record, 21 delete_map_record,
22} from '@api/Maps'; 22} from "@api/Maps";
23import { 23import {
24 delete_map_summary, 24 delete_map_summary,
25 post_map_summary, 25 post_map_summary,
26 put_map_image, 26 put_map_image,
27 put_map_summary, 27 put_map_summary,
28} from '@api/Mod'; 28} from "@api/Mod";
29import { UploadRunContent } from '@customTypes/Content'; 29import { UploadRunContent } from "@customTypes/Content";
30 30
31// add new api call function entries here 31// add new api call function entries here
32// example usage: API.get_games(); 32// example usage: API.get_games();
@@ -91,7 +91,7 @@ export const API = {
91 delete_map_summary(token, map_id, route_id), 91 delete_map_summary(token, map_id, route_id),
92}; 92};
93 93
94const BASE_API_URL: string = '/api/v1/'; 94const BASE_API_URL: string = "/api/v1/";
95 95
96export function url(path: string): string { 96export function url(path: string): string {
97 return BASE_API_URL + path; 97 return BASE_API_URL + path;
diff --git a/frontend/src/api/Auth.ts b/frontend/src/api/Auth.ts
index e495d47..98c6d36 100644
--- a/frontend/src/api/Auth.ts
+++ b/frontend/src/api/Auth.ts
@@ -1,5 +1,5 @@
1import axios from 'axios'; 1import axios from "axios";
2import { url } from '@api/Api'; 2import { url } from "@api/Api";
3 3
4export const get_token = async (): Promise<string | undefined> => { 4export const get_token = async (): Promise<string | undefined> => {
5 const response = await axios.get(url(`token`)); 5 const response = await axios.get(url(`token`));
@@ -10,5 +10,5 @@ export const get_token = async (): Promise<string | undefined> => {
10}; 10};
11 11
12export const delete_token = async () => { 12export const delete_token = async () => {
13 await axios.delete(url('token')); 13 await axios.delete(url("token"));
14}; 14};
diff --git a/frontend/src/api/Games.ts b/frontend/src/api/Games.ts
index 0e47091..b739f80 100644
--- a/frontend/src/api/Games.ts
+++ b/frontend/src/api/Games.ts
@@ -1,9 +1,9 @@
1import axios from 'axios'; 1import axios from "axios";
2import { url } from '@api/Api'; 2import { url } from "@api/Api";
3import { GameChapter, GamesChapters } from '@customTypes/Chapters'; 3import { GameChapter, GamesChapters } from "@customTypes/Chapters";
4import { Game } from '@customTypes/Game'; 4import { Game } from "@customTypes/Game";
5import { Map } from '@customTypes/Map'; 5import { Map } from "@customTypes/Map";
6import { Search } from '@customTypes/Search'; 6import { Search } from "@customTypes/Search";
7 7
8export const get_games = async (): Promise<Game[]> => { 8export 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.ts b/frontend/src/api/Maps.ts
index 3a22f88..2485941 100644
--- a/frontend/src/api/Maps.ts
+++ b/frontend/src/api/Maps.ts
@@ -1,12 +1,12 @@
1import axios from 'axios'; 1import axios from "axios";
2import { url } from '@api/Api'; 2import { url } from "@api/Api";
3import { MapDiscussionContent, UploadRunContent } from '@customTypes/Content'; 3import { MapDiscussionContent, UploadRunContent } from "@customTypes/Content";
4import { 4import {
5 MapSummary, 5 MapSummary,
6 MapLeaderboard, 6 MapLeaderboard,
7 MapDiscussions, 7 MapDiscussions,
8 MapDiscussion, 8 MapDiscussion,
9} from '@customTypes/Map'; 9} from "@customTypes/Map";
10 10
11export const get_map_summary = async (map_id: string): Promise<MapSummary> => { 11export const get_map_summary = async (map_id: string): Promise<MapSummary> => {
12 const response = await axios.get(url(`maps/${map_id}/summary`)); 12 const response = await axios.get(url(`maps/${map_id}/summary`));
@@ -27,9 +27,9 @@ export const get_map_leaderboard = async (
27 // map the kind of leaderboard 27 // map the kind of leaderboard
28 data.records = data.records.map((record: any) => { 28 data.records = data.records.map((record: any) => {
29 if (record.host && record.partner) { 29 if (record.host && record.partner) {
30 return { ...record, kind: 'multiplayer' }; 30 return { ...record, kind: "multiplayer" };
31 } else { 31 } else {
32 return { ...record, kind: 'singleplayer' }; 32 return { ...record, kind: "singleplayer" };
33 } 33 }
34 }); 34 });
35 return data; 35 return data;
diff --git a/frontend/src/api/Mod.ts b/frontend/src/api/Mod.ts
index 69e76c5..d682f1a 100644
--- a/frontend/src/api/Mod.ts
+++ b/frontend/src/api/Mod.ts
@@ -1,6 +1,6 @@
1import axios from 'axios'; 1import axios from "axios";
2import { url } from '@api/Api'; 2import { url } from "@api/Api";
3import { ModMenuContent } from '@customTypes/Content'; 3import { ModMenuContent } from "@customTypes/Content";
4 4
5export const put_map_image = async ( 5export const put_map_image = async (
6 token: string, 6 token: string,
diff --git a/frontend/src/api/Rankings.ts b/frontend/src/api/Rankings.ts
index 9afd999..b8d9bec 100644
--- a/frontend/src/api/Rankings.ts
+++ b/frontend/src/api/Rankings.ts
@@ -1,6 +1,6 @@
1import axios from 'axios'; 1import axios from "axios";
2import { url } from '@api/Api'; 2import { url } from "@api/Api";
3import { Ranking, SteamRanking } from '@customTypes/Ranking'; 3import { Ranking, SteamRanking } from "@customTypes/Ranking";
4 4
5export const get_official_rankings = async (): Promise<Ranking> => { 5export 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.ts b/frontend/src/api/User.ts
index 4ce21e1..004aa22 100644
--- a/frontend/src/api/User.ts
+++ b/frontend/src/api/User.ts
@@ -1,6 +1,6 @@
1import axios from 'axios'; 1import axios from "axios";
2import { url } from '@api/Api'; 2import { url } from "@api/Api";
3import { UserProfile } from '@customTypes/Profile'; 3import { UserProfile } from "@customTypes/Profile";
4 4
5export const get_user = async (user_id: string): Promise<UserProfile> => { 5export 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}`));