angular requires special treatment for DELETE

This commit is contained in:
Johannes Zellner
2016-02-10 17:12:58 +01:00
parent 94bd0c606b
commit 820e417026
3 changed files with 19 additions and 1 deletions

View File

@@ -100,6 +100,13 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
Client.removeGroup($scope.groupRemove.group.id, $scope.groupRemove.password, function (error) {
$scope.groupRemove.busy = false;
if (error && error.statusCode === 403) {
$scope.groupRemove.error.password = 'Wrong password';
$scope.groupRemove.password = '';
$scope.groupRemoveForm.password.$setPristine();
$('#groupRemovePasswordInput').focus();
return;
}
if (error) return console.error('Unable to remove group.', error.statusCode, error.message);
refresh();