fix choosing maps
This commit is contained in:
parent
f1dec16571
commit
1c5e14cd47
1 changed files with 75 additions and 18 deletions
|
|
@ -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'});
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue