Added post.id in backend to display posts

This commit is contained in:
shobhitm23
2019-10-31 14:15:40 -04:00
parent 7341de742e
commit a4b7f7a107
2 changed files with 5 additions and 3 deletions

View File

@@ -92,9 +92,10 @@ class user extends Component {
label={{topic}.topic.topic}
onDelete={handleDelete}/>)
) : (<p> loading topics...</p>);
let recentPostsMarkup = this.state.posts ? (
this.state.posts.map(post => <Posts key={post.createdAt} post={post}/>)
let posts = classes.data
let recentPostsMarkup = posts ? (
this.state.posts.map(post => <Posts key={post.id} post={post}/>)
) : ( <p> Loading... </p> );
return (