06/01 Fix PDF statement import issue 2
This commit is contained in:
@@ -314,8 +314,17 @@
|
|||||||
fd.append('file', selectedFile);
|
fd.append('file', selectedFile);
|
||||||
if (colMap) fd.append('col_map', JSON.stringify(colMap));
|
if (colMap) fd.append('col_map', JSON.stringify(colMap));
|
||||||
|
|
||||||
fetch('{{ url_for("bank_import.parse") }}', { method: 'POST', body: fd })
|
fetch('{{ url_for("bank_import.parse") }}', {
|
||||||
.then(r => r.json())
|
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 => {
|
.then(data => {
|
||||||
setParseLoading(false);
|
setParseLoading(false);
|
||||||
if (data.error) {
|
if (data.error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user