From 53337bad0623a5f32c87d760bc03efb3cfe4eab6 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Thu, 21 Nov 2024 20:06:15 +0300 Subject: feat/frontend: remove map select from upload run dialog (#239) --- frontend/src/api/Api.ts | 2 +- frontend/src/api/Maps.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'frontend/src/api') diff --git a/frontend/src/api/Api.ts b/frontend/src/api/Api.ts index 2e55ab4..4a3f907 100644 --- a/frontend/src/api/Api.ts +++ b/frontend/src/api/Api.ts @@ -35,7 +35,7 @@ export const API = { post_map_discussion: (token: string, map_id: string, content: MapDiscussionContent) => post_map_discussion(token, map_id, content), post_map_discussion_comment: (token: string, map_id: string, discussion_id: number, comment: string) => post_map_discussion_comment(token, map_id, discussion_id, comment), - post_record: (token: string, run: UploadRunContent) => post_record(token, run), + post_record: (token: string, run: UploadRunContent, map_id: number) => post_record(token, run, map_id), delete_map_discussion: (token: string, map_id: string, discussion_id: number) => delete_map_discussion(token, map_id, discussion_id), diff --git a/frontend/src/api/Maps.ts b/frontend/src/api/Maps.ts index 89657b5..3832a2e 100644 --- a/frontend/src/api/Maps.ts +++ b/frontend/src/api/Maps.ts @@ -73,9 +73,9 @@ export const delete_map_discussion = async (token: string, map_id: string, discu return response.data.success; }; -export const post_record = async (token: string, run: UploadRunContent): Promise<[boolean, string]> => { +export const post_record = async (token: string, run: UploadRunContent, map_id: number): Promise<[boolean, string]> => { if (run.partner_demo) { - const response = await axios.postForm(url(`maps/${run.map_id}/record`), { + const response = await axios.postForm(url(`maps/${map_id}/record`), { "host_demo": run.host_demo, "partner_demo": run.partner_demo, }, { @@ -83,16 +83,16 @@ export const post_record = async (token: string, run: UploadRunContent): Promise "Authorization": token, } }); - return [ response.data.success, response.data.message ]; + return [response.data.success, response.data.message]; } else { - const response = await axios.postForm(url(`maps/${run.map_id}/record`), { + const response = await axios.postForm(url(`maps/${map_id}/record`), { "host_demo": run.host_demo, }, { headers: { "Authorization": token, } }); - return [ response.data.success, response.data.message ]; + return [response.data.success, response.data.message]; } } -- cgit v1.2.3