mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
eee84ab5f7
no issue - display a confirmation modal when bulk deleting members - hit the `DELETE /members/?all=true` endpoint when confirming - show counts of members deleted/skipped - fix selection reset when leaving edit mode
32 lines
735 B
JavaScript
32 lines
735 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()
|
|
});
|