06/01 Fix PDF statement import issue 2
This commit is contained in:
@@ -314,8 +314,17 @@
|
||||
fd.append('file', selectedFile);
|
||||
if (colMap) fd.append('col_map', JSON.stringify(colMap));
|
||||
|
||||
fetch('{{ url_for("bank_import.parse") }}', { method: 'POST', body: fd })
|
||||
.then(r => r.json())
|
||||
fetch('{{ url_for("bank_import.parse") }}', {
|
||||
method: 'POST',
|
||||
headers: { 'X-CSRFToken': CSRF },
|
||||
body: fd,
|
||||
})
|
||||
.then(r => {
|
||||
if (!r.ok && !r.headers.get('content-type')?.includes('application/json')) {
|
||||
throw new Error(`Server error ${r.status} — check server logs for details.`);
|
||||
}
|
||||
return r.json();
|
||||
})
|
||||
.then(data => {
|
||||
setParseLoading(false);
|
||||
if (data.error) {
|
||||
|
||||
Reference in New Issue
Block a user