Defaulted to 'active' status when creating Offers

refs https://github.com/TryGhost/Team/issues/1131

This ensures that Offers are active by default.
This commit is contained in:
Fabien O'Carroll 2021-10-12 17:10:51 +02:00
parent a772f5b82f
commit 04b9944e67

View File

@ -259,7 +259,7 @@ class Offer {
const type = OfferType.create(data.type);
const cadence = OfferCadence.create(data.cadence);
const duration = OfferDuration.create(data.duration, data.duration_in_months);
const status = OfferStatus.create(data.status);
const status = OfferStatus.create(data.status || 'active');
if (cadence.value === 'year' && duration.value.type === 'repeating') {
throw new errors.InvalidOfferDuration({