|
|
@ -45,9 +45,14 @@ function ($scope, Network, Messages, errorMsgFilter) {
|
|
|
|
if (network.Checked) {
|
|
|
|
if (network.Checked) {
|
|
|
|
counter = counter + 1;
|
|
|
|
counter = counter + 1;
|
|
|
|
Network.remove({id: network.Id}, function (d) {
|
|
|
|
Network.remove({id: network.Id}, function (d) {
|
|
|
|
|
|
|
|
var error = errorMsgFilter(d);
|
|
|
|
|
|
|
|
if (error) {
|
|
|
|
|
|
|
|
Messages.send("Error", "Unable to remove network with active endpoints");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
Messages.send("Network deleted", network.Id);
|
|
|
|
Messages.send("Network deleted", network.Id);
|
|
|
|
var index = $scope.networks.indexOf(network);
|
|
|
|
var index = $scope.networks.indexOf(network);
|
|
|
|
$scope.networks.splice(index, 1);
|
|
|
|
$scope.networks.splice(index, 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
complete();
|
|
|
|
complete();
|
|
|
|
}, function (e) {
|
|
|
|
}, function (e) {
|
|
|
|
Messages.error("Failure", e.data);
|
|
|
|
Messages.error("Failure", e.data);
|
|
|
|