diff --git a/UI/src/components/ImportCSV-Base.vue b/UI/src/components/ImportCSV-Base.vue
index b389825b2f..aadf878afa 100644
--- a/UI/src/components/ImportCSV-Base.vue
+++ b/UI/src/components/ImportCSV-Base.vue
@@ -18,7 +18,8 @@ export default {
default: true
}
},
- setup() {
+ emits: [ "upload-success", "upload-error" ],
+ setup(props, { emit }) {
const { t } = useI18n();
let notify = inject("notify");
let form = ref(null);
@@ -32,7 +33,10 @@ export default {
dismissReceiver
});
},
- "success": () => { notify({ title: t("Uploaded") }); },
+ "success": () => {
+ notify({ title: t("Uploaded") });
+ emit("upload-success");
+ },
"submitError": (ctx, { event }) => {
notify({
title: t("Failure sending CSV"),
diff --git a/UI/src/views/GIFI.vue b/UI/src/views/GIFI.vue
index bc52cbe3fd..d55f1b1c97 100644
--- a/UI/src/views/GIFI.vue
+++ b/UI/src/views/GIFI.vue
@@ -27,7 +27,7 @@ const store = useGIFIsStore();
createRole="gifi_create" />
{{ $t("Import") }}
-
+
diff --git a/UI/src/views/ImportCSV-GIFI.vue b/UI/src/views/ImportCSV-GIFI.vue
index 205409dc40..25e2d00dac 100644
--- a/UI/src/views/ImportCSV-GIFI.vue
+++ b/UI/src/views/ImportCSV-GIFI.vue
@@ -5,12 +5,13 @@ import ImportCSVBase from "@/components/ImportCSV-Base";
export default {
components: {
- "import-csv": ImportCSVBase
+ "import-csv": ImportCSVBase
},
+ emits: [ "upload-success", "upload-error" ],
data() {
- return {
- };
- }
+ return {
+ };
+ },
};
@@ -18,7 +19,9 @@ export default {
+ :transactionFields="false"
+ @upload-success="$emit('upload-success')"
+ @upload-error="$emit('upload-error')">
Import
GIFI codes
diff --git a/UI/src/views/ImportCSV-SIC.vue b/UI/src/views/ImportCSV-SIC.vue
index 71f4a81fbc..88b871f026 100644
--- a/UI/src/views/ImportCSV-SIC.vue
+++ b/UI/src/views/ImportCSV-SIC.vue
@@ -5,10 +5,11 @@ import ImportCSVBase from "@/components/ImportCSV-Base";
export default {
components: {
- "import-csv": ImportCSVBase
+ "import-csv": ImportCSVBase
},
+ emits: [ "upload-success", "upload-error" ],
data() {
- return {
+ return {
};
}
};
@@ -18,7 +19,9 @@ export default {
+ :transactionFields="false"
+ @upload-success="$emit('upload-success')"
+ @upload-error="$emit('upload-error')">
Import
SIC codes
diff --git a/UI/src/views/SIC.vue b/UI/src/views/SIC.vue
index 745c478f2a..1bc4593f93 100644
--- a/UI/src/views/SIC.vue
+++ b/UI/src/views/SIC.vue
@@ -26,7 +26,7 @@ const store = useSICsStore();
createRole="sic_create" />
{{ t("Import") }}
-
+
diff --git a/lib/LedgerSMB/Scripts/import_csv.pm b/lib/LedgerSMB/Scripts/import_csv.pm
index 7e7f7f08c2..65cd932da5 100644
--- a/lib/LedgerSMB/Scripts/import_csv.pm
+++ b/lib/LedgerSMB/Scripts/import_csv.pm
@@ -596,7 +596,7 @@ sub begin_import {
if (ref($template_setup->{$request->{type}}) eq 'CODE') {
$template_setup->{$request->{type}}($request);
}
- return [ 200, [ 'Content-Type' => 'text/plain' ], [ '' ] ];
+ return [ 200, [ 'Content-Type' => 'application/json' ], [ '{}' ] ];
}