Skip to content

Commit

Permalink
user refData for single relationship
Browse files Browse the repository at this point in the history
mjmaix committed Aug 3, 2014
1 parent 882ccee commit f23a52f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routes/download/list.js
Original file line number Diff line number Diff line change
@@ -30,8 +30,8 @@ exports = module.exports = function(req, res) {
if (field.type === 'boolean') {
rowData[field.path] = i.get(field.path) ? 'true' : 'false';
} else if(field.type === 'relationship') {
var refData = i.get(field.path);
if(field.many){
var refData = i.get(field.path);
var values = [];
if (Array.isArray(refData) && refData.length) {
_.forEach(refData, function(i) {
@@ -40,7 +40,7 @@ exports = module.exports = function(req, res) {
}
rowData[field.path] = values.join(', ');
}else {
rowData[field.path] = field.refList.getDocumentName(i);
rowData[field.path] = field.refList.getDocumentName(refData);
}
} else {
rowData[field.path] = field.format(i);

0 comments on commit f23a52f

Please sign in to comment.