Ghost/ghost/admin/app/components/modal-unsubscribe-members.js
Rishabh 6d9b8175a2 Wired bulk action operations on filtered members list
closes https://github.com/TryGhost/Team/issues/969

Wires the bulk action operation UI to Ghost API to perform operations on filtered member list - unsubscribe filtered members, add label to filtered members or remove label from filtered members
2021-08-13 21:50:46 +05:30

31 lines
708 B
JavaScript

import ModalComponent from 'ghost-admin/components/modal-base';
import {alias} from '@ember/object/computed';
import {inject as service} from '@ember/service';
import {task} from 'ember-concurrency';
export default ModalComponent.extend({
membersStats: service(),
shouldCancelSubscriptions: false,
// Allowed actions
confirm: () => {},
member: alias('model'),
actions: {
confirm() {
this.unsubscribeMember.perform();
}
},
unsubscribeMemberTask: task(function* () {
try {
yield this.confirm();
this.membersStats.invalidate();
} finally {
this.send('closeModal');
}
}).drop()
});