mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 10:42:45 +03:00
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:
parent
fa73786c92
commit
0f4e97eae7
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user