2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00
discourse/app/assets/javascripts/admin/controllers/modals/admin-agree-flag.js.es6
2017-09-25 12:25:14 -04:00

21 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');
});
},
}
});