Merge pull request #10702 from Budibase/fix/data-export-rows

Fixes and updates for export internal rows
This commit is contained in:
deanhannigan 2023-05-26 09:08:35 +01:00 committed by GitHub
commit 567ee451dd
2 changed files with 21 additions and 12 deletions

View File

@ -113,7 +113,9 @@
})
download(data, `export.${exportFormat}`)
} else if (filters || sorting) {
const data = await API.exportRows({
let response
try {
response = await API.exportRows({
tableId: view,
format: exportFormat,
search: {
@ -123,7 +125,14 @@
paginate: false,
},
})
download(data, `export.${exportFormat}`)
} 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()
}

View File

@ -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
}