mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 22:01:49 +03:00
3eb8b91a6b
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.
16 lines
471 B
JavaScript
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'
|
|
};
|
|
};
|