Add alias and list ldap routes

This commit is contained in:
Girish Ramakrishnan
2016-09-25 18:59:11 -07:00
parent 4b34f823a7
commit baa2dbbf39
4 changed files with 178 additions and 20 deletions

View File

@@ -582,7 +582,7 @@ function setAliases(userId, aliases, callback) {
if (error && error.reason === DatabaseError.NOT_FOUND) return callback(new UserError(UserError.NOT_FOUND));
if (error) return callback(new UserError(UserError.INTERNAL_ERROR, error));
mailboxdb.setAliases(user.username, aliases, userId, mailboxdb.TYPE_USER, function (error) {
mailboxdb.setAliasesOf(user.username, aliases, userId, mailboxdb.TYPE_USER, function (error) {
if (error && error.reason === DatabaseError.ALREADY_EXISTS) return callback(new UserError(UserError.ALREADY_EXISTS, error.message));
if (error && error.reason === DatabaseError.NOT_FOUND) return callback(new UserError(UserError.NOT_FOUND));
if (error) return callback(new UserError(UserError.INTERNAL_ERROR, error));
@@ -601,7 +601,7 @@ function getAliases(userId, callback) {
if (error && error.reason === DatabaseError.NOT_FOUND) return callback(new UserError(UserError.NOT_FOUND));
if (error) return callback(new UserError(UserError.INTERNAL_ERROR, error));
mailboxdb.getAliases(user.username, function (error, aliases) {
mailboxdb.getAliasesOf(user.username, function (error, aliases) {
if (error && error.reason === DatabaseError.NOT_FOUND) return callback(new UserError(UserError.NOT_FOUND));
if (error) return callback(new UserError(UserError.INTERNAL_ERROR, error));