less db calls

v1.18.x
barisusakli 11 years ago
parent dc441c2873
commit 7a61645256

@ -181,12 +181,12 @@
return callback(null, null); return callback(null, null);
} }
async.some(groupNames, function(groupName, next) { Groups.isMemberOfGroups(uid, groupNames, function(err, isMembers) {
Groups.isMember(uid, groupName, function(err, isMember) { if (err) {
next(!err && isMember); return callback(err);
}); }
}, function(result) {
callback(null, result); callback(null, isMembers.indexOf(true) !== -1)
}); });
}); });
}; };

Loading…
Cancel
Save