Fixed broken betting
This commit is contained in:
parent
5cbb637890
commit
6282648ab6
2 changed files with 2 additions and 1 deletions
|
@ -38,7 +38,7 @@
|
||||||
let response = await fetch("/api/endBet", {
|
let response = await fetch("/api/endBet", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
"correct": possible.index(prompt("What was the correct answer?"))
|
"correct": possible.indexOf(prompt("What was the correct answer?"))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
document.getElementById("question").innerText = data.question;
|
document.getElementById("question").innerText = data.question;
|
||||||
outcomes = data.possible;
|
outcomes = data.possible;
|
||||||
document.getElementById("possible").innerText = "Possible outcomes: " + outcomes.join(", ");
|
document.getElementById("possible").innerText = "Possible outcomes: " + outcomes.join(", ");
|
||||||
|
document.getElementById("bet").disabled = false;
|
||||||
// noinspection ES6MissingAwait
|
// noinspection ES6MissingAwait
|
||||||
updateTimer(data.timeToBet);
|
updateTimer(data.timeToBet);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue