Added redirect on create
This commit is contained in:
parent
c0c7397a82
commit
8527560333
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue