From 04b9944e670680ded924129be57cdd8ed055bd9e Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Tue, 12 Oct 2021 17:10:51 +0200 Subject: [PATCH] Defaulted to 'active' status when creating Offers refs https://github.com/TryGhost/Team/issues/1131 This ensures that Offers are active by default. --- ghost/offers/lib/domain/models/Offer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/offers/lib/domain/models/Offer.js b/ghost/offers/lib/domain/models/Offer.js index 7c127f7fba..998c7aecdf 100644 --- a/ghost/offers/lib/domain/models/Offer.js +++ b/ghost/offers/lib/domain/models/Offer.js @@ -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({