2019-02-22 14:31:45 +03:00
|
|
|
import ModalComponent from 'ghost-admin/components/modal-base';
|
|
|
|
import {alias} from '@ember/object/computed';
|
|
|
|
import {task} from 'ember-concurrency';
|
|
|
|
|
|
|
|
export default ModalComponent.extend({
|
2019-12-13 14:38:37 +03:00
|
|
|
// Allowed actions
|
|
|
|
confirm: () => {},
|
2019-02-22 14:31:45 +03:00
|
|
|
|
2019-12-13 14:38:37 +03:00
|
|
|
member: alias('model'),
|
2019-02-22 14:31:45 +03:00
|
|
|
|
|
|
|
actions: {
|
|
|
|
confirm() {
|
|
|
|
this.deleteMember.perform();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
deleteMember: task(function* () {
|
|
|
|
try {
|
2019-12-13 14:38:37 +03:00
|
|
|
yield this.confirm();
|
2019-02-22 14:31:45 +03:00
|
|
|
} finally {
|
|
|
|
this.send('closeModal');
|
|
|
|
}
|
|
|
|
}).drop()
|
|
|
|
});
|