diff --git a/twistter-frontend/src/pages/user.js b/twistter-frontend/src/pages/user.js index 7633295..af0243c 100644 --- a/twistter-frontend/src/pages/user.js +++ b/twistter-frontend/src/pages/user.js @@ -63,6 +63,7 @@ class user extends Component { }); }) .catch(err => console.log(err)); + axios .get("/getAllTopics") .then(res => { @@ -71,16 +72,25 @@ class user extends Component { }) }) .catch(err => console.log(err)); + + axios + .get("/getallPostsforUser") + .then(res => { + console.log(res.data); + this.setState({ + posts: res.data + }) + }) + .catch(err => console.log(err)); } + render() { const classes = this.props; - //const authenticated = this.props.user.authenticated; let profileMarkup = this.state.profile ? (
loading username...
); - let topicsMarkup = this.state.topics ? ( this.state.topics.map(topic =>{post.body}
) + ) : (My Posts
); + return (Post
+ {postMarkup}