master
Max 5 years ago
parent ef0f26fdcc
commit a78bcf96aa

@ -35,6 +35,7 @@ export class FeedComponent implements OnInit {
this.user = user; this.user = user;
this.loggedIn = user.loggedIn; this.loggedIn = user.loggedIn;
if(this.loggedIn) this.userId = user.userID; if(this.loggedIn) this.userId = user.userID;
console.log("the userId is " + this.userId);
}); });
this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => { this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => {
this.feedNew = this.feedService.renderAllPosts(response.json()); this.feedNew = this.feedService.renderAllPosts(response.json());

@ -119,7 +119,7 @@ export class FeedService {
getBodyForGetAllPostsByUserId(pUserId: number) { getBodyForGetAllPostsByUserId(pUserId: number) {
const body = {query: `query ($userId: ID) { 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: { }`, variables: {
userId: pUserId userId: pUserId
}}; }};

Loading…
Cancel
Save