Refactor flagged posts into components
This commit is contained in:
@@ -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');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user