Fix: HTTP handling was broken after updating libs.
This commit is contained in:
parent
03083b819b
commit
c3d527f2bc
|
@ -9,10 +9,11 @@ angular.module('ffffng')
|
||||||
$scope.onSubmitToken = function (token) {
|
$scope.onSubmitToken = function (token) {
|
||||||
$scope.token = token;
|
$scope.token = token;
|
||||||
return NodeService.getNode(token)
|
return NodeService.getNode(token)
|
||||||
.success(function (node) {
|
.then(function (response) {
|
||||||
|
var node = response.data;
|
||||||
ConfirmDeletionDialog.open(node).result.then(function () {
|
ConfirmDeletionDialog.open(node).result.then(function () {
|
||||||
NodeService.deleteNode(token)
|
NodeService.deleteNode(token)
|
||||||
.success(function () {
|
.then(function () {
|
||||||
$scope.deleted = true;
|
$scope.deleted = true;
|
||||||
$scope.hostname = node.hostname;
|
$scope.hostname = node.hostname;
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,9 +16,9 @@ angular.module('ffffng')
|
||||||
|
|
||||||
$scope.save = function (node) {
|
$scope.save = function (node) {
|
||||||
return NodeService.createNode(node)
|
return NodeService.createNode(node)
|
||||||
.success(function (response) {
|
.then(function (response) {
|
||||||
$scope.node = response.node;
|
$scope.node = response.data.node;
|
||||||
$scope.token = response.token;
|
$scope.token = response.data.token;
|
||||||
$scope.saved = true;
|
$scope.saved = true;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,9 +21,9 @@ angular.module('ffffng')
|
||||||
|
|
||||||
$scope.save = function (node) {
|
$scope.save = function (node) {
|
||||||
return NodeService.updateNode(node, $scope.token)
|
return NodeService.updateNode(node, $scope.token)
|
||||||
.success(function (response) {
|
.then(function (response) {
|
||||||
$scope.node = response.node;
|
$scope.node = response.data.node;
|
||||||
$scope.token = response.token;
|
$scope.token = response.data.token;
|
||||||
$scope.saved = true;
|
$scope.saved = true;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -159,11 +159,11 @@ angular.module('ffffng')
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.error = null;
|
$scope.error = null;
|
||||||
$scope.save(node).catch(function (response, code) {
|
$scope.save(node).catch(function (response) {
|
||||||
// error
|
// error
|
||||||
switch (code) {
|
switch (response.status) {
|
||||||
case 409: // conflict
|
case 409: // conflict
|
||||||
$scope.error = duplicateError[response.field];
|
$scope.error = duplicateError[response.data.field];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$scope.error = 'Es ist ein Fehler aufgetreten. Versuche es später noch einmal.';
|
$scope.error = 'Es ist ein Fehler aufgetreten. Versuche es später noch einmal.';
|
||||||
|
|
|
@ -15,8 +15,8 @@ angular.module('ffffng')
|
||||||
|
|
||||||
$scope.error = null;
|
$scope.error = null;
|
||||||
$scope.onSubmit(token)
|
$scope.onSubmit(token)
|
||||||
.catch(function (response, code) {
|
.catch(function (response) {
|
||||||
switch (code) {
|
switch (response.status) {
|
||||||
case 404: // not found
|
case 404: // not found
|
||||||
$scope.error = 'Zum Token wurde kein passender Eintrag gefunden.';
|
$scope.error = 'Zum Token wurde kein passender Eintrag gefunden.';
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue