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

21 lines
431 B
JavaScript
Raw Normal View History

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