2016-05-24 15:06:59 +03:00
|
|
|
import ModalComponent from 'ghost-admin/components/modals/base';
|
2017-08-22 10:53:26 +03:00
|
|
|
import {alias} from '@ember/object/computed';
|
2017-05-29 21:50:03 +03:00
|
|
|
import {invokeAction} from 'ember-invoke-action';
|
2017-01-19 14:40:31 +03:00
|
|
|
import {task} from 'ember-concurrency';
|
2015-11-18 13:50:48 +03:00
|
|
|
|
|
|
|
export default ModalComponent.extend({
|
|
|
|
|
2016-08-24 16:26:29 +03:00
|
|
|
user: alias('model'),
|
2015-11-18 13:50:48 +03:00
|
|
|
|
2017-01-19 14:40:31 +03:00
|
|
|
deleteUser: task(function* () {
|
|
|
|
try {
|
|
|
|
yield invokeAction(this, 'confirm');
|
|
|
|
} finally {
|
|
|
|
this.send('closeModal');
|
|
|
|
}
|
|
|
|
}).drop(),
|
|
|
|
|
2015-11-18 13:50:48 +03:00
|
|
|
actions: {
|
|
|
|
confirm() {
|
2017-01-19 14:40:31 +03:00
|
|
|
this.get('deleteUser').perform();
|
2015-11-18 13:50:48 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|