This commit is contained in:
Julian Lam
2015-02-25 09:57:32 -05:00
parent 948cd22e9c
commit ba7c873f07

View File

@@ -135,7 +135,19 @@ var async = require('async'),
userObj.isOwner = isOwner; userObj.isOwner = isOwner;
next(null, userObj); next(null, userObj);
}); });
}, next); }, function(err, users) {
if (err) {
return next();
}
next(null, users.sort(function(a, b) {
if (a.isOwner === b.isOwner) {
return 0;
} else {
return a.isOwner && !b.isOwner ? -1 : 1;
}
}));
});
} }
], next); ], next);
} else { } else {