mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 21:40:39 +03:00
16 lines
533 B
JavaScript
16 lines
533 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.stripe ? member.stripe.subscriptions : [],
|
||
|
paid: member.stripe ? member.stripe.subscriptions.length !== 0 : false
|
||
|
};
|
||
|
};
|