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

18 lines
433 B
JavaScript
Raw Normal View History

2018-04-03 14:16:57 +00:00
import Ember from 'ember';
import DS from 'ember-data';
export default Ember.Route.extend({
model(params) {
const { path } = params;
return this.store.findAll('auth-method').then(modelArray => {
const model = modelArray.findBy('id', path);
if (!model) {
const error = new DS.AdapterError();
Ember.set(error, 'httpStatus', 404);
throw error;
}
return model;
});
},
});