diff --git a/api/apps/api/src/modules/clone/export/application/request-export.ts b/api/apps/api/src/modules/clone/export/application/request-export.ts index 75e93731d8..cb81861716 100644 --- a/api/apps/api/src/modules/clone/export/application/request-export.ts +++ b/api/apps/api/src/modules/clone/export/application/request-export.ts @@ -17,12 +17,12 @@ export class RequestExport { ) {} async export(id: ResourceId, kind: ResourceKind): Promise { - const parts: ExportComponent[] = await this.resourcePieces.resolveFor( + const pieces: ExportComponent[] = await this.resourcePieces.resolveFor( id, kind, ); const exportInstance = this.eventPublisher.mergeObjectContext( - Export.project(id, parts), + Export.newOne(id, kind, pieces), ); await this.exportRepository.save(exportInstance); diff --git a/api/apps/api/src/modules/clone/export/domain/export/export.ts b/api/apps/api/src/modules/clone/export/domain/export/export.ts index 808d2ade91..3eecc576f6 100644 --- a/api/apps/api/src/modules/clone/export/domain/export/export.ts +++ b/api/apps/api/src/modules/clone/export/domain/export/export.ts @@ -30,13 +30,12 @@ export class Export extends AggregateRoot { super(); } - static project(id: ResourceId, parts: ExportComponent[]): Export { - const exportRequest = new Export( - new ExportId(v4()), - id, - ResourceKind.Project, - parts, - ); + static newOne( + id: ResourceId, + kind: ResourceKind, + parts: ExportComponent[], + ): Export { + const exportRequest = new Export(new ExportId(v4()), id, kind, parts); exportRequest.apply( parts