Add mailbox add error handling

This commit is contained in:
Johannes Zellner
2018-04-06 16:51:57 +02:00
parent 32454ba64a
commit f60258ed71
2 changed files with 9 additions and 1 deletions
+8 -1
View File
@@ -182,7 +182,9 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
$scope.mailboxes = {
mailboxes: [],
add: {
error: '',
busy: false,
name: '',
owner: null,
@@ -192,8 +194,13 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
Client.addMailbox($scope.selectedDomain.domain, $scope.mailboxes.add.name, $scope.mailboxes.add.owner.id, function (error) {
$scope.mailboxes.add.busy = false;
if (error) return console.error(error);
if (error) {
$scope.mailboxes.add.error = error.message;
return;
}
$scope.mailboxes.add.error = '';
$scope.mailboxes.add.name = '';
$scope.mailboxes.add.owner = null;