mirror of
https://github.com/discourse/discourse.git
synced 2025-02-24 10:31:54 +08:00
22 lines
603 B
JavaScript
22 lines
603 B
JavaScript
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
|
import DeleteSpammerModal from 'admin/mixins/delete-spammer-modal';
|
|
|
|
export default Ember.Controller.extend(ModalFunctionality, DeleteSpammerModal, {
|
|
removeAfter: null,
|
|
|
|
actions: {
|
|
agreeDeleteSpammer(user) {
|
|
return this.removeAfter(user.deleteAsSpammer()).then(() => {
|
|
this.send('closeModal');
|
|
});
|
|
},
|
|
|
|
perform(action) {
|
|
let flaggedPost = this.get('model');
|
|
return this.removeAfter(flaggedPost.agreeFlags(action)).then(() => {
|
|
this.send('closeModal');
|
|
});
|
|
},
|
|
}
|
|
});
|