From a78bcf96aa17d52019f4bc9af0796a84380a8fcb Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 19 Dec 2019 00:12:59 +0100 Subject: [PATCH] fix --- src/app/components/feed/feed.component.ts | 1 + src/app/services/feed/feed.service.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/components/feed/feed.component.ts b/src/app/components/feed/feed.component.ts index aa6599e..f374334 100644 --- a/src/app/components/feed/feed.component.ts +++ b/src/app/components/feed/feed.component.ts @@ -35,6 +35,7 @@ export class FeedComponent implements OnInit { this.user = user; this.loggedIn = user.loggedIn; if(this.loggedIn) this.userId = user.userID; + console.log("the userId is " + this.userId); }); this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => { this.feedNew = this.feedService.renderAllPosts(response.json()); diff --git a/src/app/services/feed/feed.service.ts b/src/app/services/feed/feed.service.ts index 40351aa..afb51be 100644 --- a/src/app/services/feed/feed.service.ts +++ b/src/app/services/feed/feed.service.ts @@ -119,7 +119,7 @@ export class FeedService { getBodyForGetAllPostsByUserId(pUserId: number) { const body = {query: `query ($userId: ID) { - getPosts (first: 1000, offset: 0) {id, content, htmlContent, upvotes, downvotes, userVote, author{name, handle, id}, createdAt} + getPosts (first: 1000, offset: 0, userId: $userId) {id, content, htmlContent, upvotes, downvotes, userVote, author{name, handle, id}, createdAt} }`, variables: { userId: pUserId }};