style change

v1.18.x
barisusakli
parent d7df6c0b06
commit 93ae5e2a3f

@ -1,24 +1,24 @@
'use strict'; 'use strict';
var async = require('async'), var async = require('async');
posts = require('../posts'), var posts = require('../posts');
db = require('../database'); var db = require('../database');
module.exports = function(Categories) { module.exports = function(Categories) {
Categories.getActiveUsers = function(cid, callback) { Categories.getActiveUsers = function(cid, callback) {
async.waterfall([ async.waterfall([
function(next) { function (next) {
db.getSortedSetRevRange('cid:' + cid + ':pids', 0, 24, next); db.getSortedSetRevRange('cid:' + cid + ':pids', 0, 24, next);
}, },
function(pids, next) { function (pids, next) {
posts.getPostsFields(pids, ['uid'], next); posts.getPostsFields(pids, ['uid'], next);
}, },
function(posts, next) { function (posts, next) {
var uids = posts.map(function(post) { var uids = posts.map(function(post) {
return post.uid; return post.uid;
}).filter(function(uid, index, array) { }).filter(function(uid, index, array) {
return parseInt(uid, 10) !== 0 && array.indexOf(uid) === index; return parseInt(uid, 10) && array.indexOf(uid) === index;
}); });
next(null, uids); next(null, uids);

Loading…
Cancel
Save