Ghost/ghost/admin/app/components/modal-add-label-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

34 lines
782 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(),
selectedLabel: null,
// Allowed actions
confirm: () => {},
member: alias('model'),
actions: {
confirm() {
this.addLabelTask.perform();
},
setLabel(label) {
this.set('selectedLabel', label);
}
},
addLabelTask: task(function* () {
try {
yield this.confirm(this.selectedLabel);
this.membersStats.invalidate();
} finally {
this.send('closeModal');
}
}).drop()
});