mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-15 11:42:15 +01:00
fix error handling for organization export, fixes ST-426
This commit is contained in:
@@ -25,24 +25,27 @@ async function exportData() {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
const organizationId = getCurrentOrganizationId();
|
const organizationId = getCurrentOrganizationId();
|
||||||
if (organizationId) {
|
if (organizationId) {
|
||||||
const response = await handleApiRequestNotifications(
|
try {
|
||||||
() =>
|
const response = await handleApiRequestNotifications(
|
||||||
api.exportOrganization(
|
() =>
|
||||||
{},
|
api.exportOrganization(
|
||||||
{
|
{},
|
||||||
params: {
|
{
|
||||||
organization: organizationId,
|
params: {
|
||||||
},
|
organization: organizationId,
|
||||||
}
|
},
|
||||||
),
|
}
|
||||||
'Organization data exported successfully.',
|
),
|
||||||
'Exporting organization data failed.'
|
'Organization data exported successfully.',
|
||||||
);
|
'Exporting organization data failed.'
|
||||||
if (response) {
|
);
|
||||||
showResultModal.value = true;
|
if (response) {
|
||||||
|
showResultModal.value = true;
|
||||||
|
exportResponse.value = response;
|
||||||
|
window.open(response.download_url, '_self')?.focus();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
exportResponse.value = response;
|
|
||||||
window.open(response.download_url, '_self')?.focus();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user