Skip to content

Commit

Permalink
fix error handling for organization export, fixes ST-426
Browse files Browse the repository at this point in the history
  • Loading branch information
Onatcer committed Sep 12, 2024
1 parent 9189910 commit ac85e77
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions resources/js/Pages/Teams/Partials/ExportData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,27 @@ async function exportData() {
loading.value = true;
const organizationId = getCurrentOrganizationId();
if (organizationId) {
const response = await handleApiRequestNotifications(
() =>
api.exportOrganization(
{},
{
params: {
organization: organizationId,
},
}
),
'Organization data exported successfully.',
'Exporting organization data failed.'
);
if (response) {
showResultModal.value = true;
try {
const response = await handleApiRequestNotifications(
() =>
api.exportOrganization(
{},
{
params: {
organization: organizationId,
},
}
),
'Organization data exported successfully.',
'Exporting organization data failed.'
);
if (response) {
showResultModal.value = true;
exportResponse.value = response;
window.open(response.download_url, '_self')?.focus();
}
} finally {
loading.value = false;
exportResponse.value = response;
window.open(response.download_url, '_self')?.focus();
}
}
}
Expand Down

0 comments on commit ac85e77

Please sign in to comment.