Ghost/ghost/admin/app/components/modal-delete-member.js
Kevin Ansfield 7d997d5c2d Fixed member count after deleting a member
no issue

- the member count is automatically calculated via the length of the live members array so there's no need to manually decrement it - if we do manually decrement then the count is off by one because the auto calculation runs to get the new value before the manual decrement
2019-12-13 11:38:37 +00:00

25 lines
531 B
JavaScript

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