diff --git a/api/src/services/listing.service.ts b/api/src/services/listing.service.ts index 9b56bc5217..9feae96b80 100644 --- a/api/src/services/listing.service.ts +++ b/api/src/services/listing.service.ts @@ -895,6 +895,8 @@ export class ListingService implements OnModuleInit { } : undefined, requestedChangesUser: undefined, + publishedAt: + dto.status === ListingsStatusEnum.active ? new Date() : undefined, contentUpdatedAt: new Date(), copyOf: copyOfId ? { diff --git a/api/test/unit/services/listing.service.spec.ts b/api/test/unit/services/listing.service.spec.ts index a5c97e43a6..3d2c18c124 100644 --- a/api/test/unit/services/listing.service.spec.ts +++ b/api/test/unit/services/listing.service.spec.ts @@ -1895,6 +1895,7 @@ describe('Testing listing service', () => { data: { ...val, contentUpdatedAt: expect.anything(), + publishedAt: expect.anything(), assets: { create: [exampleAsset], },