1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app/components/modal-delete-member.js
Kevin Ansfield aa9a2d393a 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()
});