Remove node from node list after deregristration

This commit is contained in:
William Tisäter 2014-10-04 18:14:36 +02:00
parent 5ce77e0aee
commit 06bf0bb728
1 changed files with 5 additions and 1 deletions

View File

@ -285,7 +285,7 @@ ItemBaseController = Ember.ArrayController.extend({
}); });
App.NodesShowController = Ember.ObjectController.extend({ App.NodesShowController = Ember.ObjectController.extend({
needs: ["dc"], needs: ["dc", "nodes"],
dc: Ember.computed.alias("controllers.dc"), dc: Ember.computed.alias("controllers.dc"),
actions: { actions: {
@ -306,6 +306,10 @@ App.NodesShowController = Ember.ObjectController.extend({
'Node': node.Node 'Node': node.Node
}) })
}).then(function(response) { }).then(function(response) {
var nodes = controller.get('controllers.nodes').get('nodes');
controller.get('controllers.nodes').set('nodes', nodes.filter(function(n) {
return n.Node !== node.Node;
}));
controller.transitionToRoute('nodes'); controller.transitionToRoute('nodes');
}).fail(function(response) { }).fail(function(response) {
controller.set('errorMessage', 'Received error while processing: ' + response.statusText); controller.set('errorMessage', 'Received error while processing: ' + response.statusText);