From 3b94ba7dce717adf53cf9dc38418fb8aae0b5897 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Wed, 1 Sep 2021 19:10:12 +0200 Subject: [PATCH] Fixed update method not using transaction for reads no-issue Since we run our product repository methods in transactions now we must ensure that all database interations in the method use the transaction. This adds the missing options to the reading of existing prices so that they happen inside of the transaction. --- ghost/members-api/lib/repositories/product.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghost/members-api/lib/repositories/product.js b/ghost/members-api/lib/repositories/product.js index 25ac97ac30..7d018d9729 100644 --- a/ghost/members-api/lib/repositories/product.js +++ b/ghost/members-api/lib/repositories/product.js @@ -311,7 +311,7 @@ class ProductRepository { currency: data.monthly_price.currency, type: 'recurring', interval: 'month' - }); + }, options); let priceModel; if (existingPrice) { priceModel = existingPrice; @@ -358,7 +358,7 @@ class ProductRepository { currency: data.yearly_price.currency, type: 'recurring', interval: 'year' - }); + }, options); let priceModel; if (existingPrice) {