Skip to content
Snippets Groups Projects
Commit f541224e authored by Mathis Neumann's avatar Mathis Neumann
Browse files

simplify route data loading using Ember.RSVP.hash()

parent d5a94d8c
No related branches found
No related tags found
No related merge requests found
......@@ -14,22 +14,14 @@ export default Ember.Route.extend({
const createGraph = graphingService.createGraph.bind(graphingService);
this.set('loading', true);
return Ember.RSVP.Promise.all([
this.store.findAll('node'),
this.store.findAll('nodegroup'),
this.store.findAll('service'),
this.store.findAll('serviceinstance'),
this.store.findAll('communication'),
this.store.findAll('communicationinstance')
]).then(responses => {
return {
nodes: responses.get(0),
nodeGroups: responses.get(1),
services: responses.get(2),
serviceInstances: responses.get(3),
communications: responses.get(4),
communicationInstances: responses.get(5)
};}).then(createGraph).then((graph) => {
return Ember.RSVP.hash({
nodes: this.store.findAll('node'),
nodeGroups: this.store.findAll('nodegroup'),
services: this.store.findAll('service'),
serviceInstances: this.store.findAll('serviceinstance'),
communications: this.store.findAll('communication'),
communicationInstances: this.store.findAll('communicationinstance')
}).then(createGraph).then((graph) => {
this.set('loading', false);
return graph;
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment