0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Refactored members csv export for bettere readability

no issue
This commit is contained in:
Nazar Gargol 2020-03-06 13:55:07 +08:00
parent 357671549a
commit 895b3d98e7

View file

@ -47,9 +47,20 @@ module.exports = {
exportCSV(models, apiConfig, frame) {
debug('exportCSV');
const fields = ['id', 'email', 'name', 'note', 'subscribed_to_emails', 'complimentary_plan', 'stripe_customer_id', 'created_at', 'deleted_at', 'labels'];
const fields = [
'id',
'email',
'name',
'note',
'subscribed_to_emails',
'complimentary_plan',
'stripe_customer_id',
'created_at',
'deleted_at',
'labels'
];
models.members = models.members.map((member) => {
const members = models.members.map((member) => {
member = mapper.mapMember(member, frame);
let stripeCustomerId;
@ -75,7 +86,7 @@ module.exports = {
};
});
frame.response = formatCSV(models.members, fields);
frame.response = formatCSV(members, fields);
},
importCSV(data, apiConfig, frame) {