mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 03:12:54 +03:00
27 lines
678 B
JavaScript
27 lines
678 B
JavaScript
|
import ModalComponent from 'ghost-admin/components/modal-base';
|
||
|
import {alias} from '@ember/object/computed';
|
||
|
import {inject as service} from '@ember/service';
|
||
|
import {task} from 'ember-concurrency';
|
||
|
|
||
|
export default ModalComponent.extend({
|
||
|
notifications: service(),
|
||
|
|
||
|
webhook: alias('model'),
|
||
|
|
||
|
actions: {
|
||
|
confirm() {
|
||
|
this.deleteWebhook.perform();
|
||
|
}
|
||
|
},
|
||
|
|
||
|
deleteWebhook: task(function* () {
|
||
|
try {
|
||
|
yield this.confirm();
|
||
|
} catch (error) {
|
||
|
this.notifications.showAPIError(error, {key: 'webhook.delete.failed'});
|
||
|
} finally {
|
||
|
this.send('closeModal');
|
||
|
}
|
||
|
}).drop()
|
||
|
});
|