passing memberCount and createTime into getUserGroups

v1.18.x
Julian Lam 10 years ago
parent 4a7ec3ccc6
commit da0b2c84e6

@ -781,8 +781,23 @@ var async = require('async'),
groupData = groupData.filter(function(group) { groupData = groupData.filter(function(group) {
return parseInt(group.hidden, 10) !== 1 && !!group.userTitle; return parseInt(group.hidden, 10) !== 1 && !!group.userTitle;
}).map(function(group) {
group.createtimeISO = utils.toISOString(group.createtime);
return group;
}); });
async.map(groupData, function(groupObj, next) {
Groups.getMemberCount(groupObj.name, function(err, memberCount) {
if (err) { return next(err); }
groupObj.memberCount = memberCount;
next(err, groupObj);
});
}, function(err, groupData) {
if (err) {
return callback(err);
}
var groupSets = groupData.map(function(group) { var groupSets = groupData.map(function(group) {
group.labelColor = group.labelColor || '#000000'; group.labelColor = group.labelColor || '#000000';
@ -812,6 +827,7 @@ var async = require('async'),
}, callback); }, callback);
}); });
}); });
});
}; };
Groups.updateCoverPosition = function(groupName, position, callback) { Groups.updateCoverPosition = function(groupName, position, callback) {

Loading…
Cancel
Save