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
|
|
|
|
2020-06-13 03:59:33 +00:00
|
|
|
export default class ClientRoute extends Route {
|
2020-06-10 13:49:16 +00:00
|
|
|
@service store;
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2017-09-28 17:06:24 +00:00
|
|
|
model() {
|
2020-06-10 13:49:16 +00:00
|
|
|
return super.model(...arguments).catch(notifyError(this));
|
|
|
|
}
|
2017-09-28 17:06:24 +00:00
|
|
|
|
2017-09-19 14:47:10 +00:00
|
|
|
afterModel(model) {
|
2017-09-28 17:06:24 +00:00
|
|
|
if (model && model.get('isPartial')) {
|
2021-12-28 14:45:20 +00:00
|
|
|
return model.reload().then((node) => node.get('allocations'));
|
2017-09-19 14:47:10 +00:00
|
|
|
}
|
2017-09-28 17:06:24 +00:00
|
|
|
return model && model.get('allocations');
|
2020-06-10 13:49:16 +00:00
|
|
|
}
|
|
|
|
}
|