diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2024-11-04 13:47:50 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-04 13:47:50 +0300 |
| commit | eae19bb1b047b3568e7a9a624b50e80886e56331 (patch) | |
| tree | aa3215377fd1a7714e4c5763f9abf9d7dc7def2b /frontend/src/api/Mod.tsx | |
| parent | fix: remove insert trigger on users, check insert user on login err (#224) (diff) | |
| download | lphub-eae19bb1b047b3568e7a9a624b50e80886e56331.tar.gz lphub-eae19bb1b047b3568e7a9a624b50e80886e56331.tar.bz2 lphub-eae19bb1b047b3568e7a9a624b50e80886e56331.zip | |
feat/frontend: optimizing imports, file extensions (#230)
Co-authored-by: FifthWit <fifthwitbusiness@gmail.com>
Diffstat (limited to 'frontend/src/api/Mod.tsx')
| -rw-r--r-- | frontend/src/api/Mod.tsx | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/frontend/src/api/Mod.tsx b/frontend/src/api/Mod.tsx deleted file mode 100644 index 9091379..0000000 --- a/frontend/src/api/Mod.tsx +++ /dev/null | |||
| @@ -1,58 +0,0 @@ | |||
| 1 | import axios from "axios"; | ||
| 2 | import { url } from "./Api"; | ||
| 3 | import { ModMenuContent } from "../types/Content"; | ||
| 4 | |||
| 5 | export const put_map_image = async (token: string, map_id: string, image: string): Promise<boolean> => { | ||
| 6 | const response = await axios.put(url(`maps/${map_id}/image`), { | ||
| 7 | "image": image, | ||
| 8 | }, { | ||
| 9 | headers: { | ||
| 10 | "Authorization": token, | ||
| 11 | } | ||
| 12 | }); | ||
| 13 | return response.data.success; | ||
| 14 | }; | ||
| 15 | |||
| 16 | export const post_map_summary = async (token: string, map_id: string, content: ModMenuContent): Promise<boolean> => { | ||
| 17 | const response = await axios.post(url(`maps/${map_id}/summary`), { | ||
| 18 | "category_id": content.category_id, | ||
| 19 | "user_name": content.name, | ||
| 20 | "score_count": content.score, | ||
| 21 | "record_date": content.date, | ||
| 22 | "showcase": content.showcase, | ||
| 23 | "description": content.description, | ||
| 24 | }, { | ||
| 25 | headers: { | ||
| 26 | "Authorization": token, | ||
| 27 | } | ||
| 28 | }); | ||
| 29 | return response.data.success; | ||
| 30 | }; | ||
| 31 | |||
| 32 | export const put_map_summary = async (token: string, map_id: string, content: ModMenuContent): Promise<boolean> => { | ||
| 33 | const response = await axios.put(url(`maps/${map_id}/summary`), { | ||
| 34 | "route_id": content.id, | ||
| 35 | "user_name": content.name, | ||
| 36 | "score_count": content.score, | ||
| 37 | "record_date": content.date, | ||
| 38 | "showcase": content.showcase, | ||
| 39 | "description": content.description, | ||
| 40 | }, { | ||
| 41 | headers: { | ||
| 42 | "Authorization": token, | ||
| 43 | } | ||
| 44 | }); | ||
| 45 | return response.data.success; | ||
| 46 | }; | ||
| 47 | |||
| 48 | export const delete_map_summary = async (token: string, map_id: string, route_id: number): Promise<boolean> => { | ||
| 49 | const response = await axios.delete(url(`maps/${map_id}/summary`), { | ||
| 50 | data: { | ||
| 51 | "route_id": route_id, | ||
| 52 | }, | ||
| 53 | headers: { | ||
| 54 | "Authorization": token, | ||
| 55 | } | ||
| 56 | }); | ||
| 57 | return response.data.success; | ||
| 58 | }; | ||