Refactor flagged posts into components

This commit is contained in:
Robin Ward
2017-09-08 16:27:07 -04:00
parent 40eba8cd93
commit be0eb0a554
11 changed files with 241 additions and 193 deletions
@@ -5,7 +5,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
_agreeFlag(action) {
let flaggedPost = this.get('model');
return this.removeAfter(flaggedPost.agreeFlags(action), flaggedPost).then(() => {
return this.removeAfter(flaggedPost.agreeFlags(action)).then(() => {
this.send('closeModal');
});
},
@@ -6,14 +6,14 @@ export default Ember.Controller.extend(ModalFunctionality, {
actions: {
deletePostDeferFlag() {
let flaggedPost = this.get('model');
this.removeAfter(flaggedPost.deferFlags(true), flaggedPost).then(() => {
this.removeAfter(flaggedPost.deferFlags(true)).then(() => {
this.send('closeModal');
});
},
deletePostAgreeFlag() {
let flaggedPost = this.get('model');
this.removeAfter(flaggedPost.agreeFlags('delete'), flaggedPost).then(() => {
this.removeAfter(flaggedPost.agreeFlags('delete')).then(() => {
this.send('closeModal');
});
}