Ghost/ghost/admin/app/components/modal-suspend-user.js
Austin Burdine ad5528b078 Remove ember-invoke-action (#978)
closes TryGhost/Ghost#9477
- remove ember-invoke-action in favor of straight function calls
2018-03-20 14:57:59 +00:00

25 lines
541 B
JavaScript

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