added entering topics field and database call for adding topics when writing microblog

This commit is contained in:
Aditya Sankaran
2019-10-01 19:07:57 -04:00
parent 311e8b3716
commit 9d4f175a49
4 changed files with 29 additions and 9 deletions

View File

@@ -9,7 +9,8 @@ class Userline extends Component {
{
super(props);
this.state = {
microBlogs : []
microBlogs : [],
}
}
@@ -21,12 +22,16 @@ class Userline extends Component {
const post = res.data;
this.setState({microBlogs : post})
})
})
}
render() {
let sortedPosts = [];
return (
<ul>
{ this.state.microBlogs.map(microBlog => <p>{microBlog.body}</p>)}