open-vault/ui/app/controllers/vault/cluster/access/methods.js
2019-03-29 18:29:48 -06:00

26 lines
672 B
JavaScript

import Controller from '@ember/controller';
import { task } from 'ember-concurrency';
export default Controller.extend({
queryParams: {
page: 'page',
pageFilter: 'pageFilter',
},
page: 1,
pageFilter: null,
filter: null,
disableMethod: task(function*(method) {
const { type, path } = method.getProperties('type', 'path');
try {
yield method.destroyRecord();
this.get('flashMessages').success(`The ${type} Auth Method at ${path} has been disabled.`);
} catch (err) {
this.get('flashMessages').danger(
`There was an error disabling Auth Method at ${path}: ${err.errors.join(' ')}.`
);
}
}).drop(),
});