simplify map

v1.18.x
Barış Soner Uşaklı 8 years ago
parent cecdd205cd
commit 11b5a1f426

@ -39,16 +39,10 @@ flagsController.get = function(req, res, next) {
// Minimise data set for assignees so tjs does less work
results.assignees = results.assignees.map(function(userObj) {
var keep = ['uid', 'username'];
for(var prop in userObj) {
if (userObj.hasOwnProperty(prop)) {
if (keep.indexOf(prop) === -1) {
delete userObj[prop];
}
}
}
return userObj;
return {
uid: userObj.uid,
username: userObj.username
};
});
var pageCount = Math.max(1, Math.ceil(results.flagData.count / itemsPerPage));

Loading…
Cancel
Save