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

Added note column to csv import/export for members

no-issue
This commit is contained in:
Fabien O'Carroll 2019-10-10 11:51:27 +07:00
parent fe59613867
commit f3a8119870
2 changed files with 4 additions and 3 deletions

View file

@ -153,7 +153,7 @@ const members = {
return fsLib.readCSV({
path: filePath,
columnsToExtract: [{name: 'email', lookup: /email/i}, {name: 'name', lookup: /name/i}]
columnsToExtract: [{name: 'email', lookup: /email/i}, {name: 'name', lookup: /name/i}, {name: 'note', lookup: /note/i}]
}).then((result) => {
return Promise.all(result.map((entry) => {
const api = require('./index');
@ -162,7 +162,8 @@ const members = {
data: {
members: [{
email: entry.email,
name: entry.name
name: entry.name,
note: entry.note
}]
},
options: {

View file

@ -41,7 +41,7 @@ module.exports = {
exportCSV(models, apiConfig, frame) {
debug('exportCSV');
const fields = ['id', 'email', 'name', 'created_at', 'deleted_at'];
const fields = ['id', 'email', 'name', 'note', 'created_at', 'deleted_at'];
function formatCSV(data) {
let csv = `${fields.join(',')}\r\n`,