Fiksa bugs

This commit is contained in:
Trygve 2024-11-05 12:51:55 +01:00
parent a18c29cbe6
commit 956da69043

View File

@ -47,7 +47,7 @@
</fieldset> </fieldset>
<button onmousedown="update()">Oppdater tabell</button> <button onmousedown="update()">Oppdater tabell</button>
<input id="search" type="number" class="form-control" onkeydown="update()" placeholder="Søk etter startnummer"> <input id="search" type="number" class="form-control" onkeyup="update()" placeholder="Søk etter startnummer">
<br> <br>
</div> </div>
<table id="runners"></table> <table id="runners"></table>
@ -67,7 +67,7 @@ function get_control() {
function register_runner(id) { function register_runner(id) {
control = get_control(); control = get_control();
if (control == 0) { if (control == 0) {
console.error(error); console.error("Ingen post valgt");
alert("Velg en post!"); alert("Velg en post!");
return 0; return 0;
} }
@ -84,11 +84,10 @@ function register_runner(id) {
.then(response => { .then(response => {
if (response.status == 401) { if (response.status == 401) {
alert("Feil passord!") alert("Feil passord!")
} }})
}) .then((response) => update());
document.getElementById("search").focus();
update()
document.getElementById("search").focus()
}; };
function update() { function update() {
@ -99,7 +98,6 @@ function update() {
fetch(request) fetch(request)
.then((response) => response.text()) .then((response) => response.text())
.then((text) => {table.innerHTML = text;}) .then((text) => {table.innerHTML = text;})
filterTable()
} }
</script> </script>
</body> </body>