Ghost/ghost/admin/app/components/modal-unsuspend-user.js
Kevin Ansfield 9ed5aad186 Flatten nested components (#854)
no issue
- the upcoming Module Unification re-organisation in Ember will no longer support nested components
- this PR pre-emptively moves our usage of nested components into a flat file structure
2017-09-11 14:41:17 +07:00

24 lines
564 B
JavaScript

import ModalComponent from 'ghost-admin/components/modal-base';
import {alias} from '@ember/object/computed';
import {invokeAction} from 'ember-invoke-action';
import {task} from 'ember-concurrency';
export default ModalComponent.extend({
user: alias('model'),
unsuspendUser: task(function* () {
try {
yield invokeAction(this, 'confirm');
} finally {
this.send('closeModal');
}
}).drop(),
actions: {
confirm() {
return this.get('unsuspendUser').perform();
}
}
});