diff --git a/api/src/services/listing.service.ts b/api/src/services/listing.service.ts index 83ee4a265c..ff318342dc 100644 --- a/api/src/services/listing.service.ts +++ b/api/src/services/listing.service.ts @@ -896,6 +896,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], },