diff --git a/components/Report.vue b/components/Report.vue index b9bbfc7c..6710cd2d 100644 --- a/components/Report.vue +++ b/components/Report.vue @@ -191,7 +191,7 @@ userVotedThisPost() { let curUser = this.user.account.name; //check if the post contains in its original voters current user, or if it has been upvoted in current session - this.postUpvoted = this.report.active_votes.filter(voter => (voter.voter === curUser)).length > 0 || this.newlyVotedPosts.indexOf(this.report.id)!==-1; + this.postUpvoted = this.report.active_votes.filter(voter => (voter.voter === curUser)).length > 0 || this.newlyVotedPosts.indexOf(this.report.post_id)!==-1; return this.postUpvoted; }, /* function handles confirming if the user had voted already to prevent issues */ diff --git a/components/VoteModal.vue b/components/VoteModal.vue index e6887b46..f57d2605 100644 --- a/components/VoteModal.vue +++ b/components/VoteModal.vue @@ -87,8 +87,8 @@ } else { //append this entry into the list of voted posts - if (this.newlyVotedPosts.indexOf(this.postToVote.id) === -1){ - this.newlyVotedPosts.push(this.postToVote.id); + if (this.newlyVotedPosts.indexOf(this.postToVote.post_id) === -1){ + this.newlyVotedPosts.push(this.postToVote.post_id); } this.$store.commit('setNewlyVotedPosts', this.newlyVotedPosts); $(this.$refs.voteModal).modal('hide')