aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/api/Maps.ts
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2025-07-24 14:40:22 +0300
committerArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2025-07-24 14:40:22 +0300
commitb0d199936b546c75d4b19d99591237f0bf97fe55 (patch)
treee9391880e7db2bd1ea8ff25d91aeea8dd98f186e /frontend/src/api/Maps.ts
parentfix/frontend: fixed sidebar title size, removed unnecessary imports (diff)
parentfeat/backend: add newrelic integration (#274) (diff)
downloadlphub-css-overhaul.tar.gz
lphub-css-overhaul.tar.bz2
lphub-css-overhaul.zip
Merge branch 'main' into css-overhaulcss-overhaul
Diffstat (limited to 'frontend/src/api/Maps.ts')
-rw-r--r--frontend/src/api/Maps.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/frontend/src/api/Maps.ts b/frontend/src/api/Maps.ts
index 89657b5..aa967ce 100644
--- a/frontend/src/api/Maps.ts
+++ b/frontend/src/api/Maps.ts
@@ -8,8 +8,8 @@ export const get_map_summary = async (map_id: string): Promise<MapSummary> => {
8 return response.data.data; 8 return response.data.data;
9}; 9};
10 10
11export const get_map_leaderboard = async (map_id: string): Promise<MapLeaderboard | undefined> => { 11export const get_map_leaderboard = async (map_id: string, page: string): Promise<MapLeaderboard | undefined> => {
12 const response = await axios.get(url(`maps/${map_id}/leaderboards`)); 12 const response = await axios.get(url(`maps/${map_id}/leaderboards?page=${page}`));
13 if (!response.data.success) { 13 if (!response.data.success) {
14 return undefined; 14 return undefined;
15 } 15 }
@@ -73,9 +73,9 @@ export const delete_map_discussion = async (token: string, map_id: string, discu
73 return response.data.success; 73 return response.data.success;
74}; 74};
75 75
76export const post_record = async (token: string, run: UploadRunContent): Promise<[boolean, string]> => { 76export const post_record = async (token: string, run: UploadRunContent, map_id: number): Promise<[boolean, string]> => {
77 if (run.partner_demo) { 77 if (run.partner_demo) {
78 const response = await axios.postForm(url(`maps/${run.map_id}/record`), { 78 const response = await axios.postForm(url(`maps/${map_id}/record`), {
79 "host_demo": run.host_demo, 79 "host_demo": run.host_demo,
80 "partner_demo": run.partner_demo, 80 "partner_demo": run.partner_demo,
81 }, { 81 }, {
@@ -83,16 +83,16 @@ export const post_record = async (token: string, run: UploadRunContent): Promise
83 "Authorization": token, 83 "Authorization": token,
84 } 84 }
85 }); 85 });
86 return [ response.data.success, response.data.message ]; 86 return [response.data.success, response.data.message];
87 } else { 87 } else {
88 const response = await axios.postForm(url(`maps/${run.map_id}/record`), { 88 const response = await axios.postForm(url(`maps/${map_id}/record`), {
89 "host_demo": run.host_demo, 89 "host_demo": run.host_demo,
90 }, { 90 }, {
91 headers: { 91 headers: {
92 "Authorization": token, 92 "Authorization": token,
93 } 93 }
94 }); 94 });
95 return [ response.data.success, response.data.message ]; 95 return [response.data.success, response.data.message];
96 } 96 }
97} 97}
98 98