mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
added groups page to user profile
This commit is contained in:
@@ -233,6 +233,29 @@ accountsController.getTopics = function(req, res, next) {
|
||||
getFromUserSet('account/topics', 'topics', topics.getTopicsFromSet, 'topics', req, res, next);
|
||||
};
|
||||
|
||||
accountsController.getGroups = function(req, res, next) {
|
||||
var callerUID = req.user ? parseInt(req.user.uid, 10) : 0;
|
||||
|
||||
getBaseUser(req.params.userslug, callerUID, function(err, userData) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
if (!userData) {
|
||||
return helpers.notFound(req, res);
|
||||
}
|
||||
|
||||
groups.getUserGroups([userData.uid], function(err, groups) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
userData.groups = groups[0];
|
||||
|
||||
res.render('account/groups', userData);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
function getFromUserSet(tpl, set, method, type, req, res, next) {
|
||||
var callerUID = req.user ? parseInt(req.user.uid, 10) : 0;
|
||||
|
||||
Reference in New Issue
Block a user