mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
getMultipleUserFields will return empty ojbect if no uids are passed in
This commit is contained in:
@@ -38,6 +38,11 @@ var config = require('../config.js'),
|
|||||||
|
|
||||||
// a function I feel should be built in user not sure how baris is tackling this so oppa chicken wrapper here
|
// a function I feel should be built in user not sure how baris is tackling this so oppa chicken wrapper here
|
||||||
User.getMultipleUserFields = function(uids, fields, callback) {
|
User.getMultipleUserFields = function(uids, fields, callback) {
|
||||||
|
if(uids.length === 0) {
|
||||||
|
callback({});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var uuids = uids.filter(function(value, index, self) {
|
var uuids = uids.filter(function(value, index, self) {
|
||||||
return self.indexOf(value) === index;
|
return self.indexOf(value) === index;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user