From 4e98c62b71197ca9099356f5d048fe9feaadd546 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Mon, 26 Apr 2021 14:00:32 +0100 Subject: [PATCH] Fixed update method for Products repository no-issue When updating a Product we can pass existing Stripe Prices, these will either be adding to the database, or updated if they already exist. When updating them we were attemping to use the `id` passed in the update, which is not necessarily included. Instead we should use the `id` of the StripePrice which we have already retrieved from the database. --- ghost/members-api/lib/repositories/product/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/members-api/lib/repositories/product/index.js b/ghost/members-api/lib/repositories/product/index.js index 1b81b74a91..c980dcb57a 100644 --- a/ghost/members-api/lib/repositories/product/index.js +++ b/ghost/members-api/lib/repositories/product/index.js @@ -216,7 +216,7 @@ class ProductRepository { nickname: existingPrice.nickname }, { ...options, - id: existingPrice.id || options.id + id: stripePrice.id }); } }