From 4cc31d50baae7fea05cae502ffc2972b8a8ec165 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 22 Oct 2024 10:48:28 +0300 Subject: xdd --- frontend/src/api/Api.tsx | 2 +- frontend/src/components/Login.tsx | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/api/Api.tsx b/frontend/src/api/Api.tsx index ddc7ac6..053e920 100644 --- a/frontend/src/api/Api.tsx +++ b/frontend/src/api/Api.tsx @@ -49,7 +49,7 @@ export const API = { delete_map_summary: (token: string, map_id: string, route_id: number) => delete_map_summary(token, map_id, route_id), }; -const BASE_API_URL: string = "https://lp.portal2.sr/api/v1/" +const BASE_API_URL: string = "/api/v1/" export function url(path: string): string { return BASE_API_URL + path; diff --git a/frontend/src/components/Login.tsx b/frontend/src/components/Login.tsx index 77236ce..a8c5503 100644 --- a/frontend/src/components/Login.tsx +++ b/frontend/src/components/Login.tsx @@ -17,8 +17,7 @@ const Login: React.FC = ({ setToken, profile, setProfile }) => { const navigate = useNavigate(); const _login = () => { - setToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MzExNjU1NTgsIm1vZCI6dHJ1ZSwic3ViIjoiNzY1NjExOTgxMzE2Mjk5ODkifQ.KoENjj6Z41-QQu1VKvgAiACsjLK7IoVWlJgrGdr6s24"); - // window.location.href = "/api/v1/login"; + window.location.href = "/api/v1/login"; }; const _logout = () => { -- cgit v1.2.3 From ae360114069da9ef567551dede7196d7831049c1 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 22 Oct 2024 11:31:03 +0300 Subject: backend: importance of || and && --- backend/handlers/record.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/handlers/record.go b/backend/handlers/record.go index c720823..e43cc61 100644 --- a/backend/handlers/record.go +++ b/backend/handlers/record.go @@ -204,7 +204,7 @@ func CreateRecordWithDemo(c *gin.Context) { // c.JSON(http.StatusOK, models.ErrorResponse(fmt.Sprintf("Partner SteamID from demo and request does not match! Check your submission and try again.\nDemo Partner SteamID: %s\nRequest Partner SteamID: %s", convertedPartnerSteamID, record.PartnerID))) // return // } - if convertedHostSteamID != user.(models.User).SteamID || convertedPartnerSteamID != user.(models.User).SteamID { + if convertedHostSteamID != user.(models.User).SteamID && convertedPartnerSteamID != user.(models.User).SteamID { deleteFile(srv, hostDemoFileID) deleteFile(srv, partnerDemoFileID) c.JSON(http.StatusOK, models.ErrorResponse("You are permitted to only upload your own runs!")) -- cgit v1.2.3 From 3ee18a8cb3a2893f552275c35b0724daf4b8ab69 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 22 Oct 2024 12:23:35 +0300 Subject: frontend: await message --- frontend/src/components/UploadRunDialog.tsx | 22 ++++++++-------------- frontend/src/hooks/UseConfirm.tsx | 2 +- frontend/src/hooks/UseMessage.tsx | 8 +++++++- frontend/src/pages/Profile.tsx | 6 +++--- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/frontend/src/components/UploadRunDialog.tsx b/frontend/src/components/UploadRunDialog.tsx index 0476d6f..a1bebd6 100644 --- a/frontend/src/components/UploadRunDialog.tsx +++ b/frontend/src/components/UploadRunDialog.tsx @@ -19,12 +19,9 @@ interface UploadRunDialogProps { const UploadRunDialog: React.FC = ({ token, open, onClose, games }) => { - const [confirmMessage, setConfirmMessage] = React.useState("Are you sure you want to upload this demo?"); - const { message, MessageDialogComponent } = useMessage(); const { confirm, ConfirmDialogComponent } = useConfirm(); - const navigate = useNavigate(); const [uploadRunContent, setUploadRunContent] = React.useState({ @@ -95,42 +92,39 @@ const UploadRunDialog: React.FC = ({ token, open, onClose, if (token) { if (games[selectedGameID].is_coop) { if (uploadRunContent.host_demo === null) { - message("Error", "You must select a host demo to upload.") + await message("Error", "You must select a host demo to upload.") return } else if (uploadRunContent.partner_demo === null) { - message("Error", "You must select a partner demo to upload.") + await message("Error", "You must select a partner demo to upload.") return } } else { if (uploadRunContent.host_demo === null) { - message("Error", "You must select a demo to upload.") + await message("Error", "You must select a demo to upload.") return } } const demo = SourceDemoParser.default() .setOptions({ packets: true, header: true }) .parse(await uploadRunContent.host_demo.arrayBuffer()); - const scoreboard = demo.findPacket((message) => { - return message instanceof NetMessages.SvcUserMessage && message.userMessage instanceof ScoreboardTempUpdate; + const scoreboard = demo.findPacket((msg) => { + return msg instanceof NetMessages.SvcUserMessage && msg.userMessage instanceof ScoreboardTempUpdate; }) if (!scoreboard) { - message("Error", "Error while processing demo: Unable to get scoreboard result. Either there is a demo that is corrupt or haven't been recorded in challenge mode.") + await message("Error", "Error while processing demo: Unable to get scoreboard result. Either there is a demo that is corrupt or haven't been recorded in challenge mode.") return } const { portalScore, timeScore } = scoreboard.userMessage?.as() ?? {}; - console.log(`Map Name: ${demo.mapName}. Portal Count: ${portalScore}. Ticks: ${timeScore}.`); - - setConfirmMessage(`Map Name: ${demo.mapName}\nPortal Count: ${portalScore}\nTicks: ${timeScore}\n\nAre you sure you want to upload this demo?`) - const userConfirmed = await confirm("Upload demo?", confirmMessage); + const userConfirmed = await confirm("Upload Record", `Map Name: ${demo.mapName}\nPortal Count: ${portalScore}\nTicks: ${timeScore}\n\nAre you sure you want to upload this demo?`); if (!userConfirmed) { return; } const response = await API.post_record(token, uploadRunContent); - message("Message", response); + await message("Upload Record", response); // navigate(0); onClose(); } diff --git a/frontend/src/hooks/UseConfirm.tsx b/frontend/src/hooks/UseConfirm.tsx index 80a0d51..9a7853b 100644 --- a/frontend/src/hooks/UseConfirm.tsx +++ b/frontend/src/hooks/UseConfirm.tsx @@ -3,9 +3,9 @@ import ConfirmDialog from '../components/ConfirmDialog'; const useConfirm = () => { const [isOpen, setIsOpen] = useState(false); - const [resolvePromise, setResolvePromise] = useState<((value: boolean) => void) | null>(null); const [title, setTitle] = useState(""); const [subtitle, setSubtitle] = useState(""); + const [resolvePromise, setResolvePromise] = useState<((value: boolean) => void) | null>(null); const confirm = ( titleN: string, subtitleN: string ) => { setIsOpen(true); diff --git a/frontend/src/hooks/UseMessage.tsx b/frontend/src/hooks/UseMessage.tsx index 249a3bf..0d2799c 100644 --- a/frontend/src/hooks/UseMessage.tsx +++ b/frontend/src/hooks/UseMessage.tsx @@ -3,18 +3,24 @@ import MessageDialog from "../components/MessageDialog"; const useMessage = () => { const [isOpen, setIsOpen] = useState(false); - const [title, setTitle] = useState(""); const [subtitle, setSubtitle] = useState(""); + const [resolvePromise, setResolvePromise] = useState<(() => void) | null>(null); const message = (title: string, subtitle: string) => { setIsOpen(true); setTitle(title); setSubtitle(subtitle); + return new Promise((resolve) => { + setResolvePromise(() => resolve); + }) }; const handleClose = () => { setIsOpen(false); + if (resolvePromise) { + setResolvePromise(null); + } }; const MessageDialogComponent = isOpen && ( diff --git a/frontend/src/pages/Profile.tsx b/frontend/src/pages/Profile.tsx index 7559c77..05f372e 100644 --- a/frontend/src/pages/Profile.tsx +++ b/frontend/src/pages/Profile.tsx @@ -63,7 +63,7 @@ const Profile: React.FC = ({ profile, token, gameData, onDeleteRec }; const _delete_submission = async (map_id: number, record_id: number) => { - const userConfirmed = await confirm("Delete record?", "This action cannot be undone"); + const userConfirmed = await confirm("Delete Record", "Are you sure you want to delete this record?"); if (!userConfirmed) { return; @@ -71,9 +71,9 @@ const Profile: React.FC = ({ profile, token, gameData, onDeleteRec const api_success = await API.delete_map_record(token!, map_id, record_id); if (api_success) { - message("Success", "Successfully deleted record"); + await message("Delete Record", "Successfully deleted record."); } else { - message("Error", "Could not delete record"); + await message("Delete Record", "Could not delete record."); } }; -- cgit v1.2.3 From 456ad515988d7918ca64e429d50e21a969f77837 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 22 Oct 2024 12:28:34 +0300 Subject: frontend: dimmer fullscreen upload, change text --- frontend/src/components/MessageDialog.tsx | 2 +- frontend/src/css/Dialog.css | 3 +-- frontend/src/css/UploadRunDialog.css | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/MessageDialog.tsx b/frontend/src/components/MessageDialog.tsx index 0a8db42..17b1258 100644 --- a/frontend/src/components/MessageDialog.tsx +++ b/frontend/src/components/MessageDialog.tsx @@ -19,7 +19,7 @@ const MessageDialog: React.FC = ({ title, subtitle, onClose {subtitle}
- +
diff --git a/frontend/src/css/Dialog.css b/frontend/src/css/Dialog.css index f16425d..47f070b 100644 --- a/frontend/src/css/Dialog.css +++ b/frontend/src/css/Dialog.css @@ -1,10 +1,9 @@ .dimmer { position: fixed; - width: calc(100%); + width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 4; - left: 0px; } .dialog { diff --git a/frontend/src/css/UploadRunDialog.css b/frontend/src/css/UploadRunDialog.css index 6ea9884..a9037c3 100644 --- a/frontend/src/css/UploadRunDialog.css +++ b/frontend/src/css/UploadRunDialog.css @@ -36,8 +36,7 @@ div#upload-run{ position: absolute; background-color: black; opacity: .3; - left: 320px; - width: calc(100% - 320px); + width: 100%; height: 100%; z-index: 2; cursor: no-drop; -- cgit v1.2.3 From 7a6da5f1e3734278a9cc0c38c195f12525496319 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 22 Oct 2024 12:29:43 +0300 Subject: frontend: upload run dimmer zindex increase --- frontend/src/css/UploadRunDialog.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/css/UploadRunDialog.css b/frontend/src/css/UploadRunDialog.css index a9037c3..b4791c4 100644 --- a/frontend/src/css/UploadRunDialog.css +++ b/frontend/src/css/UploadRunDialog.css @@ -38,7 +38,7 @@ div#upload-run{ opacity: .3; width: 100%; height: 100%; - z-index: 2; + z-index: 3; cursor: no-drop; } -- cgit v1.2.3 From a23e718908b80809945ccd5850009eae1e404663 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 22 Oct 2024 12:30:50 +0300 Subject: frontend: upload run dimmer zindex increase --- frontend/src/css/UploadRunDialog.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/css/UploadRunDialog.css b/frontend/src/css/UploadRunDialog.css index b4791c4..f2b7ed0 100644 --- a/frontend/src/css/UploadRunDialog.css +++ b/frontend/src/css/UploadRunDialog.css @@ -13,7 +13,7 @@ div#upload-run{ left: calc(50% + 160px); top: 130px; transform: translateX(-50%); background-color: #2b2e46; - z-index: 2; color: white; + z-index: 3; color: white; font-family: BarlowSemicondensed-SemiBold; } -- cgit v1.2.3 From c5154b2203342280a0cf75bb5f25311e6112400e Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 22 Oct 2024 12:41:44 +0300 Subject: frontend: update profile after upload run --- frontend/src/App.tsx | 7 ++++++- frontend/src/api/Maps.tsx | 4 ++-- frontend/src/components/UploadRunDialog.tsx | 9 ++++----- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index d1d501d..6953de9 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -81,7 +81,6 @@ const App: React.FC = () => { return ( <> - setUploadRunDialog(false)} games={games} /> setUploadRunDialog(true)} /> } /> @@ -95,6 +94,12 @@ const App: React.FC = () => { }> + { + setUploadRunDialog(false); + if (token) { + _set_profile(get_user_id_from_token(token)); + } + }} games={games} /> ); }; diff --git a/frontend/src/api/Maps.tsx b/frontend/src/api/Maps.tsx index 2209788..e57fc45 100644 --- a/frontend/src/api/Maps.tsx +++ b/frontend/src/api/Maps.tsx @@ -75,7 +75,7 @@ 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 => { +export const post_record = async (token: string, run: UploadRunContent): Promise<[boolean, string]> => { if (run.partner_demo) { const response = await axios.postForm(url(`maps/${run.map_id}/record`), { "host_demo": run.host_demo, @@ -94,7 +94,7 @@ export const post_record = async (token: string, run: UploadRunContent): Promise "Authorization": token, } }); - return response.data.message; + return [ response.data.success, response.data.message ]; } } diff --git a/frontend/src/components/UploadRunDialog.tsx b/frontend/src/components/UploadRunDialog.tsx index a1bebd6..b39aab6 100644 --- a/frontend/src/components/UploadRunDialog.tsx +++ b/frontend/src/components/UploadRunDialog.tsx @@ -13,7 +13,7 @@ import useConfirm from '../hooks/UseConfirm'; interface UploadRunDialogProps { token?: string; open: boolean; - onClose: () => void; + onClose: (updateProfile: boolean) => void; games: Game[]; } @@ -123,10 +123,9 @@ const UploadRunDialog: React.FC = ({ token, open, onClose, return; } - const response = await API.post_record(token, uploadRunContent); + const [ success, response ] = await API.post_record(token, uploadRunContent); await message("Upload Record", response); - // navigate(0); - onClose(); + onClose(success); } }; @@ -193,7 +192,7 @@ const UploadRunDialog: React.FC = ({ token, open, onClose,
- +
-- cgit v1.2.3 From fb4b70bf1ec09a4ba96672cc30672783bc92ed5e Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 22 Oct 2024 13:04:04 +0300 Subject: frontend: update profile after upload run --- frontend/src/App.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 6953de9..bcc56fe 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -81,6 +81,12 @@ const App: React.FC = () => { return ( <> + { + setUploadRunDialog(false); + if (token) { + _set_profile(get_user_id_from_token(token)); + } + }} games={games} /> setUploadRunDialog(true)} /> } /> @@ -94,12 +100,6 @@ const App: React.FC = () => { }> - { - setUploadRunDialog(false); - if (token) { - _set_profile(get_user_id_from_token(token)); - } - }} games={games} /> ); }; -- cgit v1.2.3 From 87d03e1fe251af6ed2da397bbf4ff512edb8bc69 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 22 Oct 2024 13:10:10 +0300 Subject: frontend: update profile after upload run --- frontend/src/App.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index bcc56fe..e39e1b6 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -45,10 +45,9 @@ const App: React.FC = () => { setGames(games); }; - const _set_profile = async (user_id: string | undefined) => { - if (user_id) { - setProfile({} as UserProfile); // placeholder before we call actual user profile - const user = await API.get_profile(token!); + const _set_profile = async (user_id?: string) => { + if (user_id && token) { + const user = await API.get_profile(token); setProfile(user); } }; @@ -58,6 +57,7 @@ const App: React.FC = () => { setProfile(undefined); setIsModerator(false); } else { + setProfile({} as UserProfile); // placeholder before we call actual user profile _set_profile(get_user_id_from_token(token)) const modStatus = get_user_mod_from_token(token) if (modStatus) { @@ -83,7 +83,7 @@ const App: React.FC = () => { <> { setUploadRunDialog(false); - if (token) { + if (updateProfile && token) { _set_profile(get_user_id_from_token(token)); } }} games={games} /> -- cgit v1.2.3 From f47d137b41e90d4ecc541d7de49eed52ec44c091 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 22 Oct 2024 13:25:48 +0300 Subject: frontend: update profile after upload run --- frontend/src/components/UploadRunDialog.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/components/UploadRunDialog.tsx b/frontend/src/components/UploadRunDialog.tsx index b39aab6..d0b5687 100644 --- a/frontend/src/components/UploadRunDialog.tsx +++ b/frontend/src/components/UploadRunDialog.tsx @@ -125,6 +125,7 @@ const UploadRunDialog: React.FC = ({ token, open, onClose, const [ success, response ] = await API.post_record(token, uploadRunContent); await message("Upload Record", response); + console.log("weweew") onClose(success); } }; -- cgit v1.2.3 From 6c77c3522dd2c3ad5b2b9198df50323da8381b90 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 22 Oct 2024 13:28:24 +0300 Subject: frontend: fix message async hook --- frontend/src/hooks/UseMessage.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/hooks/UseMessage.tsx b/frontend/src/hooks/UseMessage.tsx index 0d2799c..6b458eb 100644 --- a/frontend/src/hooks/UseMessage.tsx +++ b/frontend/src/hooks/UseMessage.tsx @@ -19,6 +19,7 @@ const useMessage = () => { const handleClose = () => { setIsOpen(false); if (resolvePromise) { + resolvePromise(); setResolvePromise(null); } }; -- cgit v1.2.3 From 0f81fafe764f6fc4b8f64e184520b5ea0a26a0d0 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 22 Oct 2024 13:32:47 +0300 Subject: frontend: update profile on delete run --- frontend/src/App.tsx | 15 ++++----------- frontend/src/pages/Profile.tsx | 1 + 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index e39e1b6..c6952b1 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Routes, Route, useLocation } from "react-router-dom"; +import { Routes, Route } from "react-router-dom"; import { UserProfile } from './types/Profile'; import Sidebar from './components/Sidebar'; @@ -18,22 +18,15 @@ import { API } from './api/Api'; import Maplist from './pages/Maplist'; import Rankings from './pages/Rankings'; import { get_user_id_from_token, get_user_mod_from_token } from './utils/Jwt'; -import { MapDeleteEndpoint } from './types/Map'; const App: React.FC = () => { const [token, setToken] = React.useState(undefined); const [profile, setProfile] = React.useState(undefined); const [isModerator, setIsModerator] = React.useState(false); - const [msgIsOpen, setMsgIsOpen] = React.useState(false); - const [games, setGames] = React.useState([]); const [uploadRunDialog, setUploadRunDialog] = React.useState(false); - const [uploadRunDialogMapID, setUploadRunDialogMapID] = React.useState(undefined); - - const [confirmDialogOpen, setConfirmDialogOpen] = React.useState(false); - const [currDeleteMapInfo, setCurrDeleteMapInfo] = React.useState(); const _fetch_token = async () => { const token = await API.get_token(); @@ -83,18 +76,18 @@ const App: React.FC = () => { <> { setUploadRunDialog(false); - if (updateProfile && token) { + if (updateProfile) { _set_profile(get_user_id_from_token(token)); } }} games={games} /> setUploadRunDialog(true)} /> } /> - setConfirmDialogOpen(true)} />} /> + _set_profile(get_user_id_from_token(token))} />} /> } /> } /> }> - }/> + } /> } /> } /> }> diff --git a/frontend/src/pages/Profile.tsx b/frontend/src/pages/Profile.tsx index 05f372e..5d1c75d 100644 --- a/frontend/src/pages/Profile.tsx +++ b/frontend/src/pages/Profile.tsx @@ -72,6 +72,7 @@ const Profile: React.FC = ({ profile, token, gameData, onDeleteRec const api_success = await API.delete_map_record(token!, map_id, record_id); if (api_success) { await message("Delete Record", "Successfully deleted record."); + onDeleteRecord(); } else { await message("Delete Record", "Could not delete record."); } -- cgit v1.2.3 From 51fc58f03b7aa60ae59bfae4c385438425218c92 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:40:30 +0300 Subject: backend: specify 250mb limit --- RULES.md | 1 + backend/main.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/RULES.md b/RULES.md index 3645d8f..ffd344d 100644 --- a/RULES.md +++ b/RULES.md @@ -22,6 +22,7 @@ Both `.vtf` and `.vmt` files associated with these textures can be modified. - Proof of your run must be recorded using demos. To start recording, type `record ` when entering the map, or use the SAR plugin with the command `sar_record_at 0`. - A valid demo begins when the player can move and ends when the player touches the end flags. - For cooperative runs, both players must submit their demos. +- For technical reasons, there is a 250 MB limit for demo files. If you have a demo file bigger than 250 MB that you need to submit, please contact an admin in the Discord server. ### Console Commands & Cheats diff --git a/backend/main.go b/backend/main.go index 26aa852..edbe7f8 100644 --- a/backend/main.go +++ b/backend/main.go @@ -47,6 +47,6 @@ func main() { // router.NoRoute(func(c *gin.Context) { // c.File("../frontend/build/index.html") // }) - router.MaxMultipartMemory = 500 << 20 // 500 mb limit for demos + router.MaxMultipartMemory = 250 << 20 // 250 mb limit for demos router.Run(fmt.Sprintf(":%s", os.Getenv("PORT"))) } -- cgit v1.2.3 From 83f138fff4999348262845c2b8ab2a9dbbf318a8 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:26:35 +0300 Subject: frontend: fix broken msg for coop submission --- frontend/src/api/Maps.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/api/Maps.tsx b/frontend/src/api/Maps.tsx index e57fc45..80f88d4 100644 --- a/frontend/src/api/Maps.tsx +++ b/frontend/src/api/Maps.tsx @@ -85,7 +85,7 @@ export const post_record = async (token: string, run: UploadRunContent): Promise "Authorization": token, } }); - return response.data.message; + return [ response.data.success, response.data.message ]; } else { const response = await axios.postForm(url(`maps/${run.map_id}/record`), { "host_demo": run.host_demo, -- cgit v1.2.3 From dda495de3fd79e4a36713c6012820b7e3394d172 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:38:51 +0300 Subject: docs: point to pektezoldev --- README.md | 2 +- backend/docs/docs.go | 2 +- backend/docs/index.html | 2 +- backend/docs/swagger.json | 2 +- backend/docs/swagger.yaml | 2 +- backend/main.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5ff180e..6d1eef5 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ There's also discussion tabs for each map to act like forum pages in order to ta ## Documentation -Full API documentation can be found at https://lp.ardapektezol.com/api/v1/ +Full API documentation can be found at https://lp.pektezol.dev/api/v1/ ## License diff --git a/backend/docs/docs.go b/backend/docs/docs.go index 5327961..71bd68e 100644 --- a/backend/docs/docs.go +++ b/backend/docs/docs.go @@ -2218,7 +2218,7 @@ const docTemplate = `{ // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "1.0", - Host: "lp.ardapektezol.com", + Host: "lp.pektezol.dev", BasePath: "/api/v1", Schemes: []string{}, Title: "Least Portals Hub", diff --git a/backend/docs/index.html b/backend/docs/index.html index 8d12274..f2b358d 100644 --- a/backend/docs/index.html +++ b/backend/docs/index.html @@ -17,7 +17,7 @@