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.
This commit is contained in:
Fabien O'Carroll 2021-08-26 16:07:06 +02:00
parent fa73786c92
commit 0f4e97eae7

View File

@ -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) {