open-vault/ui/app/components/auth-config-form/options.js
Matthew Irish ca872c5de1
UI: Mount tune fix (#4431)
* serialize instead of toJSON when mount tuning

* add tests

* remove model unit test

* fix typo
2018-04-23 15:32:43 -05:00

23 lines
677 B
JavaScript

import AuthConfigComponent from './config';
import { task } from 'ember-concurrency';
import DS from 'ember-data';
export default AuthConfigComponent.extend({
saveModel: task(function*() {
const model = this.get('model');
let data = model.get('config').serialize();
data.description = model.get('description');
try {
yield model.tune(data);
} catch (err) {
// AdapterErrors are handled by the error-message component
// in the form
if (err instanceof DS.AdapterError === false) {
throw err;
}
return;
}
this.get('flashMessages').success('The configuration options were saved successfully.');
}),
});