Fix reported errors to make build pass
This commit is contained in:
@@ -40,18 +40,22 @@ console.log(request);
|
|||||||
|
|
||||||
fetch(window.location.href, {
|
fetch(window.location.href, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: note.innerText,
|
body: note.textContent,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.status != 200) {
|
if (res.status != 200) {
|
||||||
console.error(res);
|
console.error(res);
|
||||||
const err = res.statusText;
|
const err = res.statusText;
|
||||||
const kaput = document.querySelector("#kaput");
|
const kaput = document.querySelector("#kaput");
|
||||||
kaput.classList.remove("display-none");
|
if (!kaput) {
|
||||||
kaput.innerText = err;
|
console.error("No kaput found");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
kaput?.classList.remove("display-none");
|
||||||
|
kaput.textContent = err;
|
||||||
} else {
|
} else {
|
||||||
const kaput = document.querySelector("#kaput");
|
const kaput = document.querySelector("#kaput");
|
||||||
kaput.classList.add("display-none");
|
kaput?.classList.add("display-none");
|
||||||
note.innerText = "";
|
note.textContent = "";
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -60,8 +64,7 @@ console.log(request);
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Layout title="Players">
|
<Layout title="Players">
|
||||||
<div id="kaput" class="display-none text-center text-2xl text-red-600 py-2">
|
<div id="kaput" class="display-none text-center text-2xl text-red-600 py-2"></div>
|
||||||
</div>
|
|
||||||
<form class="p-5 min-h-[25rem] h-[25rem]">
|
<form class="p-5 min-h-[25rem] h-[25rem]">
|
||||||
<div class="h-full w-full mb-4 border rounded-lg shadow-lg overflow-hidden flex flex-col">
|
<div class="h-full w-full mb-4 border rounded-lg shadow-lg overflow-hidden flex flex-col">
|
||||||
<div
|
<div
|
||||||
@@ -96,7 +99,7 @@ console.log(request);
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{data.data.map((player) => (
|
{data.data.map((player) => (
|
||||||
<tr key={player.name} class="hover:bg-gray-50">
|
<tr class="hover:bg-gray-50">
|
||||||
<td class="p-4 border border-gray-300">
|
<td class="p-4 border border-gray-300">
|
||||||
<a href={`/player/${player.name}`} class="text-blue-600 hover:underline">
|
<a href={`/player/${player.name}`} class="text-blue-600 hover:underline">
|
||||||
{player.name}
|
{player.name}
|
||||||
|
Reference in New Issue
Block a user