2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00

Changed members CSV export to match import format

refs c295435b41

- The import format changed the `subscribed` to `subscribed_to_emails`. Export should have the same format as import for consistency
This commit is contained in:
Nazar Gargol 2020-02-05 15:34:55 +08:00
parent c863d215fb
commit 68a36dd799
2 changed files with 3 additions and 3 deletions

View file

@ -47,7 +47,7 @@ module.exports = {
exportCSV(models, apiConfig, frame) {
debug('exportCSV');
const fields = ['id', 'email', 'name', 'note', 'subscribed', 'complimentary_plan', 'stripe_customer_id', 'created_at', 'deleted_at'];
const fields = ['id', 'email', 'name', 'note', 'subscribed_to_emails', 'complimentary_plan', 'stripe_customer_id', 'created_at', 'deleted_at'];
models.members = models.members.map((member) => {
member = mapper.mapMember(member);
@ -62,7 +62,7 @@ module.exports = {
email: member.email,
name: member.name,
note: member.note,
subscribed: member.subscribed,
subscribed_to_emails: member.subscribed,
complimentary_plan: member.comped,
stripe_customer_id: stripeCustomerId,
created_at: member.created_at,

View file

@ -276,7 +276,7 @@ describe('Members API', function () {
.then((res) => {
should.not.exist(res.headers['x-cache-invalidate']);
res.headers['content-disposition'].should.match(/Attachment;\sfilename="members/);
res.text.should.match(/id,email,name,note,subscribed,complimentary_plan,stripe_customer_id,created_at,deleted_at/);
res.text.should.match(/id,email,name,note,subscribed_to_emails,complimentary_plan,stripe_customer_id,created_at,deleted_at/);
res.text.should.match(/member1@test.com/);
res.text.should.match(/Mr Egg/);
});