From 8f333cc38bb30d7154e5d751b49ff366be5bef59 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Mon, 22 Feb 2021 14:00:24 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20comp=20plans=20for=20mem?= =?UTF-8?q?bers=20w/=20active=20subscriptions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs https://github.com/TryGhost/Team/issues/475 The subscription object here is a database model rather than an ISubscription from the stripe library, and we need to 1) use the `get` method to read attributes and 2) read the `subscription_id` attribute, as the `id` is our internal one. --- ghost/members-api/lib/repositories/member/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/members-api/lib/repositories/member/index.js b/ghost/members-api/lib/repositories/member/index.js index 168f26a9c9..ff0b578637 100644 --- a/ghost/members-api/lib/repositories/member/index.js +++ b/ghost/members-api/lib/repositories/member/index.js @@ -310,7 +310,7 @@ module.exports = class MemberRepository { // NOTE: we should only ever have 1 active subscription, but just in case there is more update is done on all of them for (const subscription of activeSubscriptions) { const updatedSubscription = await this._stripeAPIService.changeSubscriptionPlan( - subscription.id, + subscription.get('subscription_id'), complimentaryPlan.id );