Ghost/core/server/services/members/utils.js
Fabien O'Carroll 3eb8b91a6b Fixed paid flag on members
refs https://github.com/TryGhost/Ghost/issues/12602

As part of the member events, we added a third status of 'comped'.
Members with a status of 'comped' should still be considered paid, so
this fixes the definition of the paid flag to take that into account.
2021-02-25 14:26:41 +00:00

16 lines
471 B
JavaScript

module.exports.formattedMemberResponse = function formattedMemberResponse(member) {
if (!member) {
return null;
}
return {
uuid: member.uuid,
email: member.email,
name: member.name,
firstname: member.name && member.name.split(' ')[0],
avatar_image: member.avatar_image,
subscribed: !!member.subscribed,
subscriptions: member.subscriptions || [],
paid: member.status !== 'free'
};
};