mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
Fixed creating events within transaction
no-issue If we are to perform the `linkSubscription` method inside of a transaction, the addition of the paid subscription events would happen outside of the transaction, and cause errors. This ensures that we pass the options object (containing the transaction) to the models calls to add paid subscription events
This commit is contained in:
parent
9be1d2de4f
commit
907ccd9f34
@ -327,7 +327,7 @@ module.exports = class MemberRepository {
|
|||||||
to_plan: updated.get('plan_id'),
|
to_plan: updated.get('plan_id'),
|
||||||
currency: subscription.plan.currency,
|
currency: subscription.plan.currency,
|
||||||
mrr_delta: mrrDelta
|
mrr_delta: mrrDelta
|
||||||
});
|
}, options);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
await this._StripeCustomerSubscription.add(subscriptionData, options);
|
await this._StripeCustomerSubscription.add(subscriptionData, options);
|
||||||
@ -338,7 +338,7 @@ module.exports = class MemberRepository {
|
|||||||
to_plan: subscription.plan.id,
|
to_plan: subscription.plan.id,
|
||||||
currency: subscription.plan.currency,
|
currency: subscription.plan.currency,
|
||||||
mrr_delta: getMRRDelta({interval: subscription.plan.interval, amount: subscription.plan.amount, status: subscription.status})
|
mrr_delta: getMRRDelta({interval: subscription.plan.interval, amount: subscription.plan.amount, status: subscription.status})
|
||||||
});
|
}, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
let status = 'free';
|
let status = 'free';
|
||||||
|
Loading…
Reference in New Issue
Block a user