made socket logic better

This commit is contained in:
Karma Riuk
2025-05-07 18:10:21 +02:00
parent 4c2d912298
commit 522bcc7ebc
4 changed files with 24 additions and 24 deletions

View File

@ -19,12 +19,14 @@ document.getElementById("uploadBtn").onclick = async () => {
form.append("file", file);
const res = await fetch(`/answers/submit/${type}`, {
headers: {
"X-Socket-Id": socket.id,
},
method: "POST",
body: form,
});
const json = await res.json();
console.log(json);
const statusEl = document.getElementById("status");
if (res.ok) {
statusEl.style.color = "green";