open-vault/ui/app/components/identity/item-details.js
Hamid Ghaf 27bb03bbc0
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00

29 lines
656 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
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.flashMessages.success(`Successfully enabled entity: ${model.id}`);
})
.catch((e) => {
this.flashMessages.success(
`There was a problem enabling the entity: ${model.id} - ${e.errors.join(' ') || e.message}`
);
});
},
},
});