From 852756033335dc26dfceba296d76e43f19ded3b6 Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Mon, 28 Mar 2022 12:18:06 +0200 Subject: [PATCH] Added redirect on create --- src/client/src/createtournament.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/client/src/createtournament.js b/src/client/src/createtournament.js index 1d8b71e..eebbf71 100644 --- a/src/client/src/createtournament.js +++ b/src/client/src/createtournament.js @@ -60,9 +60,12 @@ function submitTournament(event) { }) .then(response => response.json()) .then(data => { - if (data.status == "OK") { + if (data.status === "OK") { alert("Tournament created successfully"); - window.location.href = "/"; + let tournamentId = data.data.tournamentId; + if (tournamentId) { + window.location.href = "/tournament/" + tournamentId; + } } else { showError(data.data) }