open-vault/ui/app/components/identity/item-details.js
Matthew Irish d509588cd2
Ember update (#5386)
Ember update - update ember-cli, ember-data, and ember to 3.4 series
2018-09-25 11:28:26 -05:00

24 lines
590 B
JavaScript

import { inject as service } from '@ember/service';
import Component from '@ember/component';
export default Component.extend({
flashMessages: service(),
actions: {
enable(model) {
model.set('disabled', false);
model
.save()
.then(() => {
this.get('flashMessages').success(`Successfully enabled entity: ${model.id}`);
})
.catch(e => {
this.get('flashMessages').success(
`There was a problem enabling the entity: ${model.id} - ${e.errors.join(' ') || e.message}`
);
});
},
},
});