add note about populate + match in chatc

This commit is contained in:
Tyler Renelle
2013-09-04 13:22:22 -04:00
parent 6b338da1f9
commit 2d53844984

View File

@@ -121,16 +121,17 @@ api.postChat = function(req, res, next) {
}
async.series([
function(cb){
group.save(cb)
},
function(cb){group.save(cb)},
function(cb){
Group.findById(group._id).populate('members', partyFields).exec(cb);
}
], function(err, results){
if (err) return res.json(500, {err:err});
// TODO This is less efficient, but see https://github.com/lefnire/habitrpg/commit/41255dc#commitcomment-4014583
var saved = results[1];
saved.members = _.filter(saved.members, function(m){return m._id != user._id});
res.json(saved);
})
}