Added error handling for export row front end and fixed row export backend behaviour
This commit is contained in:
parent
82ac46e5eb
commit
146940f6ae
|
@ -113,17 +113,26 @@
|
||||||
})
|
})
|
||||||
download(data, `export.${exportFormat}`)
|
download(data, `export.${exportFormat}`)
|
||||||
} else if (filters || sorting) {
|
} else if (filters || sorting) {
|
||||||
const data = await API.exportRows({
|
let response
|
||||||
tableId: view,
|
try {
|
||||||
format: exportFormat,
|
response = await API.exportRows({
|
||||||
search: {
|
tableId: view,
|
||||||
query: luceneFilter,
|
format: exportFormat,
|
||||||
sort: sorting?.sortColumn,
|
search: {
|
||||||
sortOrder: sorting?.sortOrder,
|
query: luceneFilter,
|
||||||
paginate: false,
|
sort: sorting?.sortColumn,
|
||||||
},
|
sortOrder: sorting?.sortOrder,
|
||||||
})
|
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 {
|
} else {
|
||||||
await exportView()
|
await exportView()
|
||||||
}
|
}
|
||||||
|
|
|
@ -415,7 +415,7 @@ export async function exportRows(ctx: UserCtx) {
|
||||||
|
|
||||||
result = await outputProcessing(table, response)
|
result = await outputProcessing(table, response)
|
||||||
} else if (query) {
|
} else if (query) {
|
||||||
let searchResponse = await exports.search(ctx)
|
let searchResponse = await search(ctx)
|
||||||
result = searchResponse.rows
|
result = searchResponse.rows
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue