From e40f07211f5f15dcb138e2520a76d13afd3c0cfd Mon Sep 17 00:00:00 2001 From: FifthWit Date: Thu, 30 Jan 2025 10:44:30 -0600 Subject: formatted with prettier --- frontend/src/api/Mod.ts | 104 ++++++++++++++++++++++++++++++------------------ 1 file changed, 66 insertions(+), 38 deletions(-) (limited to 'frontend/src/api/Mod.ts') diff --git a/frontend/src/api/Mod.ts b/frontend/src/api/Mod.ts index 1511f8b..69e76c5 100644 --- a/frontend/src/api/Mod.ts +++ b/frontend/src/api/Mod.ts @@ -1,58 +1,86 @@ -import axios from "axios"; -import { url } from "@api/Api"; -import { ModMenuContent } from "@customTypes/Content"; +import axios from 'axios'; +import { url } from '@api/Api'; +import { ModMenuContent } from '@customTypes/Content'; -export const put_map_image = async (token: string, map_id: string, image: string): Promise => { - const response = await axios.put(url(`maps/${map_id}/image`), { - "image": image, - }, { - headers: { - "Authorization": token, +export const put_map_image = async ( + token: string, + map_id: string, + image: string +): Promise => { + const response = await axios.put( + url(`maps/${map_id}/image`), + { + image: image, + }, + { + headers: { + Authorization: token, + }, } - }); + ); return response.data.success; }; -export const post_map_summary = async (token: string, map_id: string, content: ModMenuContent): Promise => { - const response = await axios.post(url(`maps/${map_id}/summary`), { - "category_id": content.category_id, - "user_name": content.name, - "score_count": content.score, - "record_date": content.date, - "showcase": content.showcase, - "description": content.description, - }, { - headers: { - "Authorization": token, +export const post_map_summary = async ( + token: string, + map_id: string, + content: ModMenuContent +): Promise => { + const response = await axios.post( + url(`maps/${map_id}/summary`), + { + category_id: content.category_id, + user_name: content.name, + score_count: content.score, + record_date: content.date, + showcase: content.showcase, + description: content.description, + }, + { + headers: { + Authorization: token, + }, } - }); + ); return response.data.success; }; -export const put_map_summary = async (token: string, map_id: string, content: ModMenuContent): Promise => { - const response = await axios.put(url(`maps/${map_id}/summary`), { - "route_id": content.id, - "user_name": content.name, - "score_count": content.score, - "record_date": content.date, - "showcase": content.showcase, - "description": content.description, - }, { - headers: { - "Authorization": token, +export const put_map_summary = async ( + token: string, + map_id: string, + content: ModMenuContent +): Promise => { + const response = await axios.put( + url(`maps/${map_id}/summary`), + { + route_id: content.id, + user_name: content.name, + score_count: content.score, + record_date: content.date, + showcase: content.showcase, + description: content.description, + }, + { + headers: { + Authorization: token, + }, } - }); + ); return response.data.success; }; -export const delete_map_summary = async (token: string, map_id: string, route_id: number): Promise => { +export const delete_map_summary = async ( + token: string, + map_id: string, + route_id: number +): Promise => { const response = await axios.delete(url(`maps/${map_id}/summary`), { data: { - "route_id": route_id, + route_id: route_id, }, headers: { - "Authorization": token, - } + Authorization: token, + }, }); return response.data.success; }; -- cgit v1.2.3