mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
26ee648397
no refs - Updates member model serializer to directly set subscriptions on member object instead of `stripe.subscriptions` - Updates all references to members subscriptions from nested `stripe.subscriptions` to `subscriptions` - Updates v3 API serializer to still use `stripe.subscriptions` - Updates tests
15 lines
471 B
JavaScript
15 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 === 'paid'
|
|
};
|
|
};
|