From 1fbbdcfc2ef895b516747f17a70b244d6743e636 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Tue, 29 Jun 2021 15:06:35 +0100 Subject: [PATCH] Included benefits with products when writing refs https://github.com/TryGhost/Team/issues/806 This allows API consumers to not need to pass an `includes` for benefits when creating or updating products. --- ghost/members-api/lib/repositories/product/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ghost/members-api/lib/repositories/product/index.js b/ghost/members-api/lib/repositories/product/index.js index a60cec4a96..f71a11f312 100644 --- a/ghost/members-api/lib/repositories/product/index.js +++ b/ghost/members-api/lib/repositories/product/index.js @@ -211,6 +211,7 @@ class ProductRepository { await product.related('stripePrices').fetch(options); await product.related('monthlyPrice').fetch(options); await product.related('yearlyPrice').fetch(options); + await product.related('benefits').fetch(options); } return product; @@ -450,6 +451,7 @@ class ProductRepository { await product.related('stripePrices').fetch(options); await product.related('monthlyPrice').fetch(options); await product.related('yearlyPrice').fetch(options); + await product.related('benefits').fetch(options); } return product;