This commit is contained in:
Julian Lam
2015-01-27 11:19:36 -05:00
parent 06238f6894
commit 08e39d150e
2 changed files with 4 additions and 5 deletions

View File

@@ -32,7 +32,7 @@ groupsController.details = function(req, res, next) {
}, next);
},
posts: function(next) {
groups.getLatestMemberPosts(req.params.name, 10, uid, next);
groups.getLatestMemberPosts(req.params.slug, 10, uid, next);
}
}, function(err, results) {
if (err) {

View File

@@ -758,11 +758,10 @@ var async = require('async'),
});
};
Groups.getLatestMemberPosts = function(groupName, max, uid, callback) {
Groups.getLatestMemberPosts = function(groupSlug, max, uid, callback) {
async.waterfall([
function(next) {
Groups.getMembers(groupName, next);
},
async.apply(Groups.getGroupNameByGroupSlug, groupSlug),
Groups.getMembers,
function(uids, next) {
if (!Array.isArray(uids) || !uids.length) {
return callback(null, []);