open-vault/ui/app/routes/vault/cluster/access/method.js
2018-04-03 09:16:57 -05:00

18 lines
433 B
JavaScript

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;
});
},
});