mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
57b1ab4800
no issue - part of ember upgrades - removed all unnecessary usage of `.get` - cleaned up imports where we had imports from the same module across multiple lines - standardized on importing specific computed helpers rather than using `computed.foo` - switched tests from using `wait()` to `settled()`
32 lines
738 B
JavaScript
32 lines
738 B
JavaScript
import ModalComponent from 'ghost-admin/components/modal-base';
|
|
import {task} from 'ember-concurrency';
|
|
|
|
export default ModalComponent.extend({
|
|
confirmed: false,
|
|
response: null,
|
|
error: null,
|
|
|
|
// Allowed actions
|
|
confirm: () => {},
|
|
|
|
actions: {
|
|
confirm() {
|
|
this.deleteMembersTask.perform();
|
|
}
|
|
},
|
|
|
|
deleteMembersTask: task(function* () {
|
|
try {
|
|
this.set('response', (yield this.confirm()));
|
|
this.set('confirmed', true);
|
|
} catch (e) {
|
|
if (e.payload?.errors) {
|
|
this.set('confirmed', true);
|
|
this.set('error', e.payload.errors[0].message);
|
|
}
|
|
|
|
throw e;
|
|
}
|
|
}).drop()
|
|
});
|