Ghost/ghost/admin/app/components/modal-delete-integration.js
Peter Zimon 04d9caefed Updated navigation (#1832)
no issue

Updated settings navigation to a completely redesigned flow for Ghost 4.0 🎉

Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
Co-authored-by: Fabien O'Carroll <fabien@allou.is>
Co-authored-by: Rish <zrishabhgarg@gmail.com>
2021-02-02 16:08:06 +00:00

26 lines
768 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({
router: service(),
notifications: service(),
integration: alias('model'),
actions: {
confirm() {
this.deleteIntegration.perform();
}
},
deleteIntegration: task(function* () {
try {
yield this.confirm();
this.router.transitionTo('integrations');
} catch (error) {
this.notifications.showAPIError(error, {key: 'integration.delete.failed'});
} finally {
this.send('closeModal');
}
}).drop()
});