This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/admin/controllers/modals/admin-agree-flag.js.es6

20 lines
560 B
JavaScript

import ModalFunctionality from 'discourse/mixins/modal-functionality';
export default Ember.Controller.extend(ModalFunctionality, {
removeAfter: null,
_agreeFlag(action) {
let flaggedPost = this.get('model');
return this.removeAfter(flaggedPost.agreeFlags(action), flaggedPost).then(() => {
this.send('closeModal');
});
},
actions: {
agreeFlagHidePost() { return this._agreeFlag("hide"); },
agreeFlagKeepPost() { return this._agreeFlag("keep"); },
agreeFlagRestorePost() { return this._agreeFlag("restore"); }
}
});