feat: change API router structure

This commit is contained in:
2025-02-11 14:14:23 +01:00
parent 55b7b6f206
commit e89a2eea20
5 changed files with 55 additions and 21 deletions

View File

@@ -60,15 +60,6 @@ h3 {
}
#control-panel {
display: flex;
flex-direction: column;
input {
margin: auto
}
}
.container {
display: flex;
flex-wrap: nowrap;
@@ -138,7 +129,43 @@ button {
z-index: 1;
}
#control-panel {
display: grid;
overflow: hidden;
margin: auto;
gap: 16px;
grid-template-columns: repeat(3, 1fr);
}
.opened {
max-height: 100vw;
transition: max-height 1s ease-in;
}
.closed {
max-height: 0px;
transition: max-height 0.5s ease-out;
}
.control {
display: flex;
flex-direction: column;
align-items: center;
border: 1px solid #404040;
padding: 8px;
}
@media only screen and (max-width: 1000px) {
#control-panel {
grid-template-columns: repeat(2, 1fr);
}
}
@media only screen and (max-width: 768px) {
#control-panel {
grid-template-columns: 1fr;
}
.submit_text {
display: none;
}

View File

@@ -8,7 +8,7 @@ import { BrowserRouter, Routes, Route } from "react-router-dom";
function App() {
//const [data, setData] = useState({ nodes: [], links: [] } as SociogramData);
//async function loadData() {
// await fetch(`${baseUrl}analysis/json`, { method: "GET" }).then(resp => resp.json() as unknown as SociogramData).then(json => { setData(json) })
// await fetch(`${baseUrl}api/analysis/json`, { method: "GET" }).then(resp => resp.json() as unknown as SociogramData).then(json => { setData(json) })
//}
//useEffect(() => { loadData() }, [])
//
@@ -17,7 +17,7 @@ function App() {
<Header />
<Routes>
<Route index element={<Rankings />} />
<Route path="analysis" element={<Analysis />} />
<Route path="/analysis" element={<Analysis />} />
</Routes>
<Footer />
</BrowserRouter>

View File

@@ -272,7 +272,7 @@ export default function Rankings() {
const [openTab, setOpenTab] = useState("Chemistry");
async function loadPlayers() {
const response = await fetch(`${baseUrl}player/list`, {
const response = await fetch(`${baseUrl}api/player/list`, {
method: "GET",
});
const data = await response.json();