fix of the json upload format

This commit is contained in:
2026-08-03 18:22:27 +02:00
parent 0f21e8d9ca
commit 579a0ddb75
+15 -5
View File
@@ -165,12 +165,22 @@
const formData = new FormData(form);
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.getAttribute('content');
const fetchOptions = {
method: 'POST',
body: formData,
credentials: 'include'
};
if (csrfToken) {
fetchOptions.headers = {
'X-CSRFToken': csrfToken
};
}
try {
const response = await fetch('/upload_csv_batch', {
method: 'POST',
body: formData,
credentials: 'include'
});
const response = await fetch('/upload_csv_batch', fetchOptions);
// Antwort einmalig als Text auslesen, um sowohl JSON als auch HTML-Fehler abzufangen
const responseText = await response.text();