If domain does not exist, go back to domain selection

This commit is contained in:
Johannes Zellner
2022-02-17 17:54:44 +01:00
parent 9481eccfb0
commit 292034c0e2

View File

@@ -824,6 +824,7 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
resetDnsRecords();
Client.getMailConfigForDomain(domainName, function (error, mailConfig) {
if (error && error.statusCode === 404) return $location.path('/email');
if (error) {
$scope.refreshBusy = false;
return console.error(error);
@@ -936,7 +937,7 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
});
Client.getDomains(function (error, result) {
if (error) return console.error('Unable to get view domain.', error);
if (error) return console.error('Unable to list domains.', error);
$scope.domain = result.filter(function (d) { return d.domain === domainName; })[0];
$scope.adminDomain = result.filter(function (d) { return d.domain === $scope.config.adminDomain; })[0];