removed parseInt from sorts

This commit is contained in:
barisusakli
2014-09-07 13:03:06 -04:00
parent 3c8ca63608
commit 6cd84ebe81
4 changed files with 7 additions and 9 deletions

View File

@@ -46,9 +46,9 @@ module.exports = function(Categories) {
function assignPostsToCategory(category, posts, next) {
category.posts = posts.filter(function(post) {
return parseInt(post.category.cid, 10) === parseInt(category.cid);
return parseInt(post.category.cid, 10) === parseInt(category.cid, 10);
}).sort(function(a, b) {
return parseInt(b.timestamp, 10) - parseInt(a.timestamp, 10);
return b.timestamp - a.timestamp;
}).slice(0, parseInt(category.numRecentReplies, 10));
next();