0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Added stripe connect guard for saving product

no refs

While saving on membership screen, we also try and save the product with any prices that have changed. In case Stripe is not connected, saving Product doesn't make sense as we should not edit prices for the default product without Stripe connection.
This commit is contained in:
Rishabh 2021-05-24 21:17:40 +05:30
parent 1b491aa083
commit 757f061362

View file

@ -271,7 +271,8 @@ export default class MembersAccessController extends Controller {
}
async saveProduct() {
if (this.product) {
const isStripeConnected = this.settings.get('stripeConnectAccountId');
if (this.product && isStripeConnected) {
const stripePrices = this.product.stripePrices || [];
const monthlyAmount = this.stripeMonthlyAmount * 100;
const yearlyAmount = this.stripeYearlyAmount * 100;