From a08690363e2bc1b513a219707af36d52cb501c53 Mon Sep 17 00:00:00 2001 From: Rishabh Garg Date: Fri, 23 Apr 2021 21:46:07 +0530 Subject: [PATCH] Updated product repo to allow editing price names (#265) refs https://github.com/TryGhost/Team/issues/616 For existing prices linked to a Product, we only allow site owners/admins to edit their nickname and nothing else. This change handles the update in Ghost, but needs extension to update the name in Stripe as well. --- ghost/members-api/lib/repositories/product/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ghost/members-api/lib/repositories/product/index.js b/ghost/members-api/lib/repositories/product/index.js index 4eb46f22ae..1b81b74a91 100644 --- a/ghost/members-api/lib/repositories/product/index.js +++ b/ghost/members-api/lib/repositories/product/index.js @@ -211,6 +211,13 @@ class ProductRepository { type: existingPrice.type, interval: existingPrice.interval }, options); + } else { + await this._StripePrice.edit({ + nickname: existingPrice.nickname + }, { + ...options, + id: existingPrice.id || options.id + }); } }