fix choosing maps

This commit is contained in:
Ronja Spiegelberg 2024-04-28 21:28:07 +02:00 • committed by Vinzenz Schroeter
commit 1c5e14cd47

View file

@ -44,3 +44,15 @@ export function postPlayer(name: string) {
return fetchTyped<string>({url, method: 'POST'});
}
export async function getMaps() {
const url = makeApiUrl('/map');
return await fetchTyped<string[]>({url, method: 'GET'});
}
export function postMaps(map: string) {
const url = makeApiUrl('/map');
url.searchParams.set('name', map);
return fetchTyped<string>({url, method: 'POST'});
}