Remove mailbox inline editing
This commit is contained in:
@@ -289,39 +289,6 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
submit: function (mailbox) {
|
||||
mailbox.busy = true;
|
||||
mailbox.error ='';
|
||||
|
||||
var aliases = mailbox.aliases.split(',').map(function (a) { return a.trim(); }).filter(function (a) { return !!a; });
|
||||
|
||||
function done(error) {
|
||||
mailbox.busy = false;
|
||||
|
||||
if (error && error.statusCode === 409) {
|
||||
var alias = error.message.match(RegExp('\'(.*)-' + $scope.selectedDomain.domain + '\''))[1];
|
||||
mailbox.error = alias + '@' + $scope.selectedDomain.domain + ' already exists';
|
||||
return;
|
||||
} else if (error && error.statusCode === 400) {
|
||||
mailbox.error = error.message;
|
||||
return;
|
||||
} else if (error) {
|
||||
console.error('Unable to configure mailbox.', error);
|
||||
return;
|
||||
}
|
||||
|
||||
// reset the dirty state
|
||||
mailbox.orig.aliases = mailbox.aliases;
|
||||
mailbox.orig.owner = mailbox.owner;
|
||||
}
|
||||
|
||||
Client.updateMailbox($scope.selectedDomain.domain, mailbox.name, mailbox.owner.id, function (error) {
|
||||
if (error) return done(error);
|
||||
|
||||
Client.setAliases($scope.selectedDomain.domain, mailbox.name, aliases, done);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user