mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-17 18:05:42 +02:00
Handle no documents to export (#10588)
* Handle no documents to export Signed-off-by: Artem Savchenko <armisav@gmail.com> * Fix formatting Signed-off-by: Artem Savchenko <armisav@gmail.com> --------- Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
@@ -539,7 +539,11 @@ export function createServer (
|
||||
|
||||
const exportResult: ExportResult = await exporter.export(options)
|
||||
|
||||
if (exportResult.success && exportResult.exportedCount > 0) {
|
||||
if (exportResult.exportedCount === 0) {
|
||||
res.status(400).send({ message: 'No documents found to export' })
|
||||
}
|
||||
|
||||
if (exportResult.success) {
|
||||
await sendExportCompletionNotification(
|
||||
measureCtx,
|
||||
targetTxOps,
|
||||
|
||||
Reference in New Issue
Block a user