Handle errors if domain is still used on deletion attempt

This commit is contained in:
Johannes Zellner
2017-11-11 22:02:34 +01:00
parent 53e3626e51
commit de44796b6f
6 changed files with 48 additions and 6 deletions

View File

@@ -109,7 +109,7 @@
<label class="control-label">Provide your password to confirm this action</label>
<div class="control-label" ng-show="(domainRemoveForm.password.$dirty && domainRemoveForm.password.$invalid) || (!domainRemoveForm.password.$dirty && domainRemove.error)">
<small ng-show=" domainRemoveForm.password.$dirty && domainRemoveForm.password.$invalid">Password required</small>
<small ng-show="!domainRemoveForm.password.$dirty && domainRemove.error">Wrong password</small>
<small ng-show="!domainRemoveForm.password.$dirty && domainRemove.error">{{ domainRemove.error }}</small>
</div>
<input type="password" class="form-control" ng-model="domainRemove.password" id="domainRemovePasswordInput" name="password" required autofocus>
</div>

View File

@@ -187,7 +187,7 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
$scope.domainRemove.error = null;
Client.removeDomain($scope.domainRemove.domain.domain, $scope.domainRemove.password, function (error) {
if (error && error.statusCode === 403) {
if (error && (error.statusCode === 403 || error.statusCode === 409)) {
$scope.domainRemove.password = '';
$scope.domainRemove.error = error.message;
$scope.domainRemoveForm.password.$setPristine();