open-nomad/ui/app/routes/clients/client.js
2022-01-20 09:46:45 -05:00

19 lines
490 B
JavaScript

import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';
import notifyError from 'nomad-ui/utils/notify-error';
export default class ClientRoute extends Route {
@service store;
model() {
return super.model(...arguments).catch(notifyError(this));
}
afterModel(model) {
if (model && model.get('isPartial')) {
return model.reload().then((node) => node.get('allocations'));
}
return model && model.get('allocations');
}
}