diff options
Diffstat (limited to 'frontend/src/api/Maps.ts')
| -rw-r--r-- | frontend/src/api/Maps.ts | 14 |
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 | ||
| 11 | export const get_map_leaderboard = async (map_id: string): Promise<MapLeaderboard | undefined> => { | 11 | export 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 | ||
| 76 | export const post_record = async (token: string, run: UploadRunContent): Promise<[boolean, string]> => { | 76 | export 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 | ||