diff --git a/src/app/components/feed/postlist/postlist.component.ts b/src/app/components/feed/postlist/postlist.component.ts index ec2e5f1..b16794d 100644 --- a/src/app/components/feed/postlist/postlist.component.ts +++ b/src/app/components/feed/postlist/postlist.component.ts @@ -22,18 +22,18 @@ export class PostlistComponent implements OnInit { voteUp(pPost: Post) { this.feedService.upvote(pPost.id).subscribe(response => { // this.voteEvent.emit(true); - pPost.userVote = response.json().data.vote.post.userVote; - pPost.upvotes = response.json().data.vote.post.upvotes; - pPost.downvotes = response.json().data.vote.post.downvotes; + pPost.userVote = response.data.vote.post.userVote; + pPost.upvotes = response.data.vote.post.upvotes; + pPost.downvotes = response.data.vote.post.downvotes; }); } voteDown(pPost: Post) { this.feedService.downvote(pPost.id).subscribe(response => { // this.voteEvent.emit(true); - pPost.userVote = response.json().data.vote.post.userVote; - pPost.upvotes = response.json().data.vote.post.upvotes; - pPost.downvotes = response.json().data.vote.post.downvotes; + pPost.userVote = response.data.vote.post.userVote; + pPost.upvotes = response.data.vote.post.upvotes; + pPost.downvotes = response.data.vote.post.downvotes; }); } diff --git a/src/app/services/feed/feed.service.ts b/src/app/services/feed/feed.service.ts index 955cf2d..99217fe 100644 --- a/src/app/services/feed/feed.service.ts +++ b/src/app/services/feed/feed.service.ts @@ -168,7 +168,7 @@ export class FeedService { if (this.renderAllPosts(response).length < 1) { this.newPostsAvailable.next(false); } - this.newPosts.next(updatedPosts); + this.newPosts.next(updatedposts); this.setPost('NEW'); }); } else if (this.activePostList === 'TOP' && this.topPostsAvailable) {