From 08e39d150e161cb04edd8ef9ff4fb69299b24e8c Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 27 Jan 2015 11:19:36 -0500 Subject: [PATCH] fixed #2655 --- src/controllers/groups.js | 2 +- src/groups.js | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/controllers/groups.js b/src/controllers/groups.js index d6307b8daf..f72d7ed1d4 100644 --- a/src/controllers/groups.js +++ b/src/controllers/groups.js @@ -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) { diff --git a/src/groups.js b/src/groups.js index 0e3f1ed066..e228ffbcf0 100644 --- a/src/groups.js +++ b/src/groups.js @@ -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, []);