From 0f4e97eae72811728d382510c26fea3625eb625f Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Thu, 26 Aug 2021 16:07:06 +0200 Subject: [PATCH] Updated getMemberIdentityData to use BREAD Service refs https://github.com/TryGhost/Team/issues/986 The getMemberIdentityData is a relic of time past. Originally it was used before we had anything like the member repository or bread controller as a way for things inside of the Members ecosystem to get access to member data. This updates it to use the same interface as everything else for fetching members so that we can rely on the shape of the data that we consider a member. This update will ensure that themes have access to the dummy subscriptions created by the `read` method of the MemberBREADService. --- ghost/members-api/lib/MembersAPI.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/ghost/members-api/lib/MembersAPI.js b/ghost/members-api/lib/MembersAPI.js index 43149c0e70..0e366ce5c7 100644 --- a/ghost/members-api/lib/MembersAPI.js +++ b/ghost/members-api/lib/MembersAPI.js @@ -273,18 +273,7 @@ module.exports = function MembersAPI({ } async function getMemberIdentityData(email) { - const model = await users.get({email}, { - withRelated: [ - 'stripeSubscriptions', - 'stripeSubscriptions.stripePrice', - 'labels', - 'products' - ] - }); - if (!model) { - return null; - } - return model.toJSON(); + return memberBREADService.read({email}); } async function getMemberIdentityToken(email) {