From 6693d470d0690e9bde6220615ee6e33bac66aae5 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Tue, 20 Jul 2021 12:24:53 +0100 Subject: [PATCH] Removed superfluous benefits relation fetch refs https://github.com/TryGhost/Team/issues/919 As we pass the `benefits` to the Product model on creation, we do not need to manually fetch them again. In fact doing so causes a strange SQL error, where we attempt to run `SELECT undefined.*`. --- ghost/members-api/lib/repositories/product.js | 1 - 1 file changed, 1 deletion(-) diff --git a/ghost/members-api/lib/repositories/product.js b/ghost/members-api/lib/repositories/product.js index 5ff09be144..82d179b1b5 100644 --- a/ghost/members-api/lib/repositories/product.js +++ b/ghost/members-api/lib/repositories/product.js @@ -211,7 +211,6 @@ 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;