From c1754e10275e8138df6ebfa35f72dd2cb926a852 Mon Sep 17 00:00:00 2001 From: Stefano Ricci Date: Thu, 14 Nov 2024 15:29:06 +0100 Subject: [PATCH] fixed CSV data import including files and categories --- .../service/DataExportJob/DataExportJob.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/server/modules/dataExport/service/DataExportJob/DataExportJob.js b/server/modules/dataExport/service/DataExportJob/DataExportJob.js index 2460fa3139..d67dd1296c 100644 --- a/server/modules/dataExport/service/DataExportJob/DataExportJob.js +++ b/server/modules/dataExport/service/DataExportJob/DataExportJob.js @@ -9,12 +9,16 @@ import CategoriesExportJob from './jobs/CategoriesExportJob' import FilesExportJob from './jobs/FilesExportJob' import ZipCreationJob from './jobs/ZipCreationJob' -const createInternalJobs = ({ includeCategories, includeFiles }) => [ - new CSVDataExtractionJob(), - ...(includeCategories ? [new CategoriesExportJob()] : []), - ...(includeFiles ? [new FilesExportJob()] : []), - new ZipCreationJob(), -] +const createInternalJobs = (params) => { + const { options } = params ?? {} + const { includeCategories, includeFiles } = options ?? {} + return [ + new CSVDataExtractionJob(), + ...(includeCategories ? [new CategoriesExportJob()] : []), + ...(includeFiles ? [new FilesExportJob()] : []), + new ZipCreationJob(), + ] +} export default class DataExportJob extends Job { constructor(params) {