ADD: added tournament creation without backend support

This commit is contained in:
hwinkel
2025-06-09 21:08:30 +02:00
parent 1a2eec44a9
commit 1e6babbf67
14 changed files with 332 additions and 34 deletions

View File

@@ -53,6 +53,15 @@ export async function deleteTournament(id: string, token: string) {
return res.json();
}
export async function fetchPlayer(token: string, id: string) {
const res = await fetch(`${API_URL}/players/${id}`, {
headers: { Authorization: `Bearer ${token}` },
});
if (!res.ok) throw new Error('Fehler beim Laden des Spielers');
return res.json();
}
export async function fetchPlayers(token: string) {
const res = await fetch(`${API_URL}/players`, {
headers: { Authorization: `Bearer ${token}` },