diff --git a/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte b/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte index 68968d5785..6cefe244bf 100644 --- a/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte @@ -113,17 +113,26 @@ }) download(data, `export.${exportFormat}`) } else if (filters || sorting) { - const data = await API.exportRows({ - tableId: view, - format: exportFormat, - search: { - query: luceneFilter, - sort: sorting?.sortColumn, - sortOrder: sorting?.sortOrder, - paginate: false, - }, - }) - download(data, `export.${exportFormat}`) + let response + try { + response = await API.exportRows({ + tableId: view, + format: exportFormat, + search: { + query: luceneFilter, + sort: sorting?.sortColumn, + sortOrder: sorting?.sortOrder, + paginate: false, + }, + }) + } catch (e) { + console.error("Failed to export", e) + notifications.error("Export Failed") + } + if (response) { + download(response, `export.${exportFormat}`) + notifications.success("Export Successful") + } } else { await exportView() } diff --git a/packages/server/src/api/controllers/row/internal.ts b/packages/server/src/api/controllers/row/internal.ts index e3cb419236..87d8cd7e9a 100644 --- a/packages/server/src/api/controllers/row/internal.ts +++ b/packages/server/src/api/controllers/row/internal.ts @@ -415,7 +415,7 @@ export async function exportRows(ctx: UserCtx) { result = await outputProcessing(table, response) } else if (query) { - let searchResponse = await exports.search(ctx) + let searchResponse = await search(ctx) result = searchResponse.rows }