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

20 lines
547 B
Text
Raw Normal View History

2014-08-12 19:04:36 -04:00
import ModalFunctionality from 'discourse/mixins/modal-functionality';
export default Ember.Controller.extend(ModalFunctionality, {
removeAfter: null,
_agreeFlag(action) {
let flaggedPost = this.get('model');
2017-09-08 16:27:07 -04:00
return this.removeAfter(flaggedPost.agreeFlags(action)).then(() => {
this.send('closeModal');
});
},
2014-08-04 22:48:04 +02:00
actions: {
agreeFlagHidePost() { return this._agreeFlag("hide"); },
agreeFlagKeepPost() { return this._agreeFlag("keep"); },
agreeFlagRestorePost() { return this._agreeFlag("restore"); }
}
});