open-vault/ui/app/components/identity/item-details.js

25 lines
563 B
JavaScript
Raw Normal View History

import Ember from 'ember';
const { inject } = Ember;
export default Ember.Component.extend({
flashMessages: inject.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(
2018-07-25 04:16:03 +00:00
`There was a problem enabling the entity: ${model.id} - ${e.errors.join(' ') || e.message}`
);
});
},
},
});