Skip to content

Commit

Permalink
Added note column to csv import/export for members
Browse files Browse the repository at this point in the history
no-issue
  • Loading branch information
allouis committed Oct 10, 2019
1 parent fe59613 commit f3a8119
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions core/server/api/canary/members.js
Expand Up @@ -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');
Expand All @@ -162,7 +162,8 @@ const members = {
data: {
members: [{
email: entry.email,
name: entry.name
name: entry.name,
note: entry.note
}]
},
options: {
Expand Down
2 changes: 1 addition & 1 deletion core/server/api/canary/utils/serializers/output/members.js
Expand Up @@ -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`,
Expand Down

0 comments on commit f3a8119

Please sign in to comment.