mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-16 02:08:47 +00:00
Added post.id in backend to display posts
This commit is contained in:
parent
7341de742e
commit
a4b7f7a107
@ -61,6 +61,7 @@ exports.getAllPosts = (req, res) => {
|
||||
userImage: doc.data().userImage,
|
||||
microBlogTitle: doc.data().microBlogTitle,
|
||||
microBlogTopics: doc.data().microBlogTopics,
|
||||
id: doc.id,
|
||||
});
|
||||
});
|
||||
return res.status(200).json(posts);
|
||||
|
||||
@ -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 (
|
||||
|
||||
Loading…
Reference in New Issue
Block a user