Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix: resolve TypeScript compilation errors in data export processor

claude[bot]39029e2d1f6f
diff --git a/packages/nocodb/src/modules/jobs/jobs/data-export/data-export.processor.ts b/packages/nocodb/src/modules/jobs/jobs/data-export/data-export.processor.ts
index 0234834481..367ef8ab97 100644
--- a/packages/nocodb/src/modules/jobs/jobs/data-export/data-export.processor.ts
+++ b/packages/nocodb/src/modules/jobs/jobs/data-export/data-export.processor.ts
@@ -153,6 +153,10 @@ export class DataExportProcessor {
}
url = await uploadFilePromise;
+
+ if (error) {
+ throw error;
+ }
}
// if url is not defined, it is local attachment
@@ -187,10 +191,6 @@ export class DataExportProcessor {
});
}
- if (error) {
- throw error;
- }
-
elapsedTime(
hrTime,
`exported data for model ${modelId} view ${viewId} as ${exportAs}`,
@@ -281,20 +281,21 @@ export class DataExportProcessor {
});
while (hasMore) {
- const result = await this.exportService.datasService.dataList(context, {
- model,
- view,
- query: {
- limit,
- offset,
- filterArrJson: options.filterArrJson,
- sortArrJson: options.sortArrJson,
- },
- baseModel,
- ignoreViewFilterAndSort: false,
- limitOverride: limit,
- skipSortBasedOnOrderCol: true,
- });
+ const result = await this.exportService
+ .getDataList(context, {
+ model,
+ view,
+ query: {
+ limit,
+ offset,
+ filterArrJson: options.filterArrJson,
+ sortArrJson: options.sortArrJson,
+ },
+ baseModel,
+ ignoreViewFilterAndSort: false,
+ limitOverride: limit,
+ skipSortBasedOnOrderCol: true,
+ });
if (result.list.length === 0) {
hasMore = false;
diff --git a/packages/nocodb/src/modules/jobs/jobs/export-import/export.service.ts b/packages/nocodb/src/modules/jobs/jobs/export-import/export.service.ts
index 4be59260c1..15fb2487bb 100644
--- a/packages/nocodb/src/modules/jobs/jobs/export-import/export.service.ts
+++ b/packages/nocodb/src/modules/jobs/jobs/export-import/export.service.ts
@@ -60,6 +60,10 @@ export class ExportService {
constructor(protected datasService: DatasService) {}
+ async getDataList(context: NcContext, param: any) {
+ return this.datasService.dataList(context, param);
+ }
+
async serializeScripts(context: NcContext) {
const serializedScripts = [];