updated censoring status logic

This commit is contained in:
Marcel Gansfusz
2025-11-04 16:55:11 +01:00
parent 2ee90cd0d7
commit 594ac1fa00

View File

@@ -284,9 +284,8 @@ function submitPdf(eve) {
}
async function submitForm(formData) {
try {
const updateEventSource = new EventSource(
window.location + "get_censor_status/" + doc.fID,
);
const updateEventSource = new EventSource("/get_censor_status/" + doc.fID);
modal.style.display = "flex";
// console.log("http://127.0.0.1:8000/get_censor_status/" + doc.fID);
updateEventSource.addEventListener("censorUpdate", function(eve) {
@@ -295,6 +294,12 @@ async function submitForm(formData) {
upload_status.innerText =
"Censoring Page " + data.page + "/" + data.pages;
});
} catch {
console.error(
"Error geting eventsource for updating censoring page count: " + error,
);
}
try {
const response = await fetch("/submit/", {
method: "POST",
body: formData,
@@ -320,7 +325,7 @@ async function submitForm(formData) {
window.alert("Error: " + (await response.json())["detail"]);
}
} catch (error) {
console.error("Error" + error);
console.error("Error submitting: " + error);
}
}
function uploadPdf(eve) {