mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2026-03-10 21:25:04 +00:00
added get request userline function
This commit is contained in:
@@ -9,16 +9,29 @@ class Userline extends Component {
|
||||
{
|
||||
super(props);
|
||||
this.state = {
|
||||
|
||||
microBlogs : []
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
componentDidMount() {
|
||||
|
||||
axios.get('http://localhost:5001/twistter-e4649/us-central1/api/getallPostsforUser')
|
||||
.then(res => {
|
||||
const post = res.data;
|
||||
this.setState({microBlogs : post})
|
||||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<p>Hi</p>
|
||||
<ul>
|
||||
{ this.state.microBlogs.map(microBlog => <p>{microBlog.body}</p>)}
|
||||
</ul>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export default Userline;
|
||||
export default Userline;
|
||||
|
||||
Reference in New Issue
Block a user