mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 05:14:12 +03:00
0d38df0f74
no issue - adds delete integration modal, and delete button on the integration page to trigger it
26 lines
777 B
JavaScript
26 lines
777 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('settings.integrations');
|
|
} catch (error) {
|
|
this.notifications.showAPIError(error, {key: 'integration.delete.failed'});
|
|
} finally {
|
|
this.send('closeModal');
|
|
}
|
|
}).drop()
|
|
});
|