2017-12-15 21:39:18 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
|
|
|
import Route from '@ember/routing/route';
|
2017-09-28 17:06:24 +00:00
|
|
|
import notifyError from 'nomad-ui/utils/notify-error';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
|
|
|
export default Route.extend({
|
2017-12-15 21:39:18 +00:00
|
|
|
store: service(),
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2017-09-28 17:06:24 +00:00
|
|
|
model() {
|
|
|
|
return this._super(...arguments).catch(notifyError(this));
|
|
|
|
},
|
|
|
|
|
2017-09-19 14:47:10 +00:00
|
|
|
afterModel(model) {
|
2017-09-28 17:06:24 +00:00
|
|
|
if (model && model.get('isPartial')) {
|
2017-09-19 14:47:10 +00:00
|
|
|
return model.reload().then(node => node.get('allocations'));
|
|
|
|
}
|
2017-09-28 17:06:24 +00:00
|
|
|
return model && model.get('allocations');
|
2017-09-19 14:47:10 +00:00
|
|
|
},
|
|
|
|
});
|