mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 17:46:16 +01:00
fix post.getUpvoters to work with an array
This commit is contained in:
@@ -347,17 +347,20 @@ SocketPosts.getUpvoters = function(socket, pids, callback) {
|
|||||||
if (err || !Array.isArray(data) || !data.length) {
|
if (err || !Array.isArray(data) || !data.length) {
|
||||||
return callback(err, []);
|
return callback(err, []);
|
||||||
}
|
}
|
||||||
var otherCount = 0;
|
|
||||||
if (data[0].length > 6) {
|
async.map(data, function(uids, next) {
|
||||||
otherCount = data[0].length - 5;
|
var otherCount = 0;
|
||||||
data[0] = data[0].slice(0, 5);
|
if (uids.length > 6) {
|
||||||
}
|
otherCount = uids.length - 5;
|
||||||
user.getUsernamesByUids(data[0], function(err, usernames) {
|
uids = uids.slice(0, 5);
|
||||||
callback(err, {
|
}
|
||||||
otherCount: otherCount,
|
user.getUsernamesByUids(uids, function(err, usernames) {
|
||||||
usernames: usernames
|
next(err, {
|
||||||
|
otherCount: otherCount,
|
||||||
|
usernames: usernames
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}, callback);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user