Rename to getGroups

This commit is contained in:
Girish Ramakrishnan
2018-06-18 14:10:29 -07:00
parent 7f3114e67d
commit b5c8e7a52a
3 changed files with 10 additions and 10 deletions

View File

@@ -19,7 +19,7 @@ exports = module.exports = {
removeMember: removeMember,
isMember: isMember,
getRoles: getRoles,
getGroups: getGroups,
setMembership: setMembership,
getMembership: getMembership
@@ -270,14 +270,14 @@ function update(groupId, data, callback) {
});
}
function getRoles(userId, callback) {
function getGroups(userId, callback) {
assert.strictEqual(typeof userId, 'string');
assert.strictEqual(typeof callback, 'function');
groupdb.getRoles(userId, function (error, roles) {
groupdb.getGroups(userId, function (error, results) {
if (error && error.reason === DatabaseError.NOT_FOUND) return callback(new GroupsError(GroupsError.NOT_FOUND));
if (error) return callback(new GroupsError(GroupsError.INTERNAL_ERROR, error));
callback(null, roles);
callback(null, results);
});
}