Add alias error reporting
This commit is contained in:
@@ -136,6 +136,7 @@
|
||||
{{ user.username }}
|
||||
</td>
|
||||
<td>
|
||||
<p ng-show="user.aliases !== user.orig.aliases && user.error" class="text-danger"><b>{{ user.error }}</b></p>
|
||||
<tag-input ng-show="user.mailboxEnabled" placeholder="add alias" taglist="user.aliases" name="aliases"></tag-input>
|
||||
</td>
|
||||
<td class="text-right no-wrap">
|
||||
|
||||
@@ -90,13 +90,19 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
||||
|
||||
submit: function (user) {
|
||||
user.busy = true;
|
||||
user.error ='';
|
||||
|
||||
var aliases = user.aliases.split(',').map(function (a) { return a.trim(); }).filter(function (a) { return !!a; });
|
||||
|
||||
function done(error) {
|
||||
user.busy = false;
|
||||
|
||||
if (error) {
|
||||
if (error && error.statusCode === 409) {
|
||||
var alias = error.message.match(RegExp('\'(.*)-' + $scope.selectedDomain.domain + '\''))[1];
|
||||
user.error = alias + '@' + $scope.selectedDomain.domain + ' already exists';
|
||||
console.log('clearly hit', user.error)
|
||||
return;
|
||||
} else if (error) {
|
||||
console.error('Unable to configure mailbox.', error);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user