mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
Updated last4 to return masked value if empty in theme
closes https://github.com/TryGhost/Team/issues/464 Currently, if the last4 value for a customer is empty, we end up showing `null` in theme where the card details are shown. The fix updates the last4 to return a masked value of **** instead of null if it's empty, ensuring themes using the last4 values don't have a `null` value shown to the user.
This commit is contained in:
parent
67bf3a77c1
commit
1a44221df1
1 changed files with 5 additions and 1 deletions
|
@ -173,7 +173,11 @@ function updateLocalTemplateOptions(req, res, next) {
|
|||
name: req.member.name,
|
||||
firstname: req.member.name && req.member.name.split(' ')[0],
|
||||
avatar_image: req.member.avatar_image,
|
||||
subscriptions: req.member.subscriptions,
|
||||
subscriptions: req.member.subscriptions && req.member.subscriptions.map((sub) => {
|
||||
return Object.assign({}, sub, {
|
||||
default_payment_card_last4: sub.default_payment_card_last4 || '****'
|
||||
});
|
||||
}),
|
||||
paid: req.member.status === 'paid'
|
||||
} : null;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue