use array.find

v1.18.x
barisusakli 8 years ago
parent 9c1b1acc5b
commit 599ac80f3d

@ -118,11 +118,8 @@ profileController.get = function(req, res, callback) {
}
);
}
userData.groups.forEach(function(group) {
if (group && group.name === userData.groupTitle) {
userData.selectedGroup = group;
}
userData.selectedGroup = userData.groups.find(function(group) {
return group && group.name === userData.groupTitle;
});
plugins.fireHook('filter:user.account', {userData: userData, uid: req.uid}, next);

Loading…
Cancel
Save