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) {