From 506b33f5a80998d1db63a1067a0181b3af0860af Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 12 Jan 2020 21:53:13 +0100 Subject: [PATCH] fixed upvote bug --- src/app/components/feed/postlist/postlist.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/feed/postlist/postlist.component.ts b/src/app/components/feed/postlist/postlist.component.ts index 8209e8b..ec2e5f1 100644 --- a/src/app/components/feed/postlist/postlist.component.ts +++ b/src/app/components/feed/postlist/postlist.component.ts @@ -22,7 +22,7 @@ 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; + pPost.userVote = response.json().data.vote.post.userVote; pPost.upvotes = response.json().data.vote.post.upvotes; pPost.downvotes = response.json().data.vote.post.downvotes; });