mirror of
https://github.com/karma-riuk/crab-webapp.git
synced 2025-07-05 06:08:13 +02:00
made socket logic better
This commit is contained in:
@ -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";
|
||||
|
Reference in New Issue
Block a user