mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 13:52:10 +03:00
296e35493d
requires https://github.com/TryGhost/Ghost/pull/10033 - added `settings.integration.webhooks.edit` route - `/integrations/:integration_id/webhooks/:webhook_id` - added error handling to the webhook form modal that copes with the actual errors we get back from the server - added `event-name` helper to display humanised event names in the webhooks list - added delete button to the webhooks list and associated confirmation modal
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()
|
|
});
|