diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2024-11-21 20:06:15 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-21 20:06:15 +0300 |
| commit | 53337bad0623a5f32c87d760bc03efb3cfe4eab6 (patch) | |
| tree | 7a542d6ba9c453c8df60ef1d05781cf1ac75b6a0 /frontend/src/api | |
| parent | feat/backend: gdrive to backblaze migration, improve create record (#237) (diff) | |
| download | lphub-53337bad0623a5f32c87d760bc03efb3cfe4eab6.tar.gz lphub-53337bad0623a5f32c87d760bc03efb3cfe4eab6.tar.bz2 lphub-53337bad0623a5f32c87d760bc03efb3cfe4eab6.zip | |
feat/frontend: remove map select from upload run dialog (#239)
Diffstat (limited to 'frontend/src/api')
| -rw-r--r-- | frontend/src/api/Api.ts | 2 | ||||
| -rw-r--r-- | frontend/src/api/Maps.ts | 10 |
2 files changed, 6 insertions, 6 deletions
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 = { | |||
| 35 | 35 | ||
| 36 | post_map_discussion: (token: string, map_id: string, content: MapDiscussionContent) => post_map_discussion(token, map_id, content), | 36 | post_map_discussion: (token: string, map_id: string, content: MapDiscussionContent) => post_map_discussion(token, map_id, content), |
| 37 | post_map_discussion_comment: (token: string, map_id: string, discussion_id: number, comment: string) => post_map_discussion_comment(token, map_id, discussion_id, comment), | 37 | post_map_discussion_comment: (token: string, map_id: string, discussion_id: number, comment: string) => post_map_discussion_comment(token, map_id, discussion_id, comment), |
| 38 | post_record: (token: string, run: UploadRunContent) => post_record(token, run), | 38 | post_record: (token: string, run: UploadRunContent, map_id: number) => post_record(token, run, map_id), |
| 39 | 39 | ||
| 40 | delete_map_discussion: (token: string, map_id: string, discussion_id: number) => delete_map_discussion(token, map_id, discussion_id), | 40 | delete_map_discussion: (token: string, map_id: string, discussion_id: number) => delete_map_discussion(token, map_id, discussion_id), |
| 41 | 41 | ||
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 | |||
| 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 | ||