fix cleanup of base64 string for zips

This commit is contained in:
Gregor Vostrak
2024-04-25 19:10:03 +02:00
parent 023f6b12b5
commit 5abcb97e98

View File

@@ -48,7 +48,10 @@ async function importData() {
); );
return; return;
} }
const base64String = await toBase64(files.value[0]); const rawBase64String = await toBase64(files.value[0]);
const base64String = rawBase64String
.split(';')[1]
.replace('base64,', '') as string;
const organizationId = getCurrentOrganizationId(); const organizationId = getCurrentOrganizationId();
if (organizationId !== null) { if (organizationId !== null) {
const { handleApiRequestNotifications } = useNotificationsStore(); const { handleApiRequestNotifications } = useNotificationsStore();
@@ -57,7 +60,7 @@ async function importData() {
api.importData( api.importData(
{ {
type: importType.value.key, type: importType.value.key,
data: base64String.replace('data:text/csv;base64,', ''), data: base64String,
}, },
{ {
params: { params: {