open-vault/ui/app/routes/vault/cluster/access/identity.js

20 lines
391 B
JavaScript
Raw Normal View History

2018-04-03 14:16:57 +00:00
import Ember from 'ember';
import DS from 'ember-data';
2018-04-03 14:16:57 +00:00
const MODEL_FROM_PARAM = {
entities: 'entity',
groups: 'group',
};
export default Ember.Route.extend({
model(params) {
let model = MODEL_FROM_PARAM[params.item_type];
if (!model) {
const error = new DS.AdapterError();
Ember.set(error, 'httpStatus', 404);
throw error;
}
2018-04-03 14:16:57 +00:00
return model;
},
});