mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-27 12:53:13 +03:00
72590083f3
refs https://github.com/TryGhost/Team/issues/585 requires https://github.com/TryGhost/Ghost/pull/12082 When a label or status filter is selected on the members screen show a "Delete selected" option in the actions dropdown. Bulk deleted members will _not_ have any subscription data modified in Stripe, if a member should be deleted and have their subscription cancelled it's necessary to do that on a per-member basis. - updated bulk delete handling to match API - added link to bulk delete confirmation modal in members actions dropdown (only shown when label, status, or search is used) - updated testing framework for members - added label factory for easier test setup - updated `GET /members` and `DEL /members` endpoints to work with label filters - updated test selectors for easier reference in tests
32 lines
736 B
JavaScript
32 lines
736 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()
|
|
});
|