mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
c7de8d3358
refs https://github.com/TryGhost/Ghost/issues/15008 - When the user is removed the new flow adds a special tag and reassignes all the user-owned posts to the owner user. Updated copy to inform about this behavior clearly
32 lines
699 B
JavaScript
32 lines
699 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({
|
|
store: service(),
|
|
|
|
// Allowed actions
|
|
confirm: () => {},
|
|
|
|
user: alias('model'),
|
|
|
|
actions: {
|
|
confirm() {
|
|
this.deleteUser.perform();
|
|
}
|
|
},
|
|
|
|
get ownerUser() {
|
|
return this.store.peekAll('user').findBy('isOwnerOnly', true);
|
|
},
|
|
|
|
deleteUser: task(function* () {
|
|
try {
|
|
yield this.confirm();
|
|
} finally {
|
|
this.send('closeModal');
|
|
}
|
|
}).drop()
|
|
});
|