Added redirect on create

This commit is contained in:
Felix Albrigtsen 2022-03-28 12:18:06 +02:00
parent c0c7397a82
commit 8527560333
1 changed files with 5 additions and 2 deletions

View File

@ -60,9 +60,12 @@ function submitTournament(event) {
}) })
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
if (data.status == "OK") { if (data.status === "OK") {
alert("Tournament created successfully"); alert("Tournament created successfully");
window.location.href = "/"; let tournamentId = data.data.tournamentId;
if (tournamentId) {
window.location.href = "/tournament/" + tournamentId;
}
} else { } else {
showError(data.data) showError(data.data)
} }