Remove unsused and poorly named groups.getGroups() API
This commit is contained in:
@@ -20,8 +20,6 @@ exports = module.exports = {
|
||||
getMembership: getMembership,
|
||||
setMembership: setMembership,
|
||||
|
||||
getGroups: getGroups,
|
||||
|
||||
_clear: clear
|
||||
};
|
||||
|
||||
@@ -274,15 +272,3 @@ function isMember(groupId, userId, callback) {
|
||||
callback(null, result.length !== 0);
|
||||
});
|
||||
}
|
||||
|
||||
function getGroups(userId, callback) {
|
||||
assert.strictEqual(typeof userId, 'string');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
database.query('SELECT ' + GROUPS_FIELDS + ' ' +
|
||||
' FROM userGroups INNER JOIN groupMembers ON userGroups.id = groupMembers.groupId AND groupMembers.userId = ?', [ userId ], function (error, results) {
|
||||
if (error) return callback(new BoxError(BoxError.DATABASE_ERROR, error));
|
||||
|
||||
callback(null, results);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user