1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app/components/modal-delete-webhook.js
Kevin Ansfield eeaa5f0999
Added edit webhook modal (#1056)
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
2018-10-19 17:34:53 +01:00

26 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()
});