mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-15 18:08:46 +00:00
sorted posts chronologically everywhere
This commit is contained in:
parent
76792148cd
commit
80a2e1894c
@ -74,6 +74,7 @@ exports.getallPosts = (req, res) => {
|
||||
allPosts.forEach(post => {
|
||||
posts.push(post.data());
|
||||
});
|
||||
posts.sort((a, b) => -a.createdAt.localeCompare(b.createdAt));
|
||||
resolve();
|
||||
})
|
||||
.catch(error => {
|
||||
@ -127,6 +128,7 @@ exports.getAlert = (req, res) => {
|
||||
myPosts.forEach(function(doc) {
|
||||
posts.push(doc.data());
|
||||
});
|
||||
posts.sort((a, b) => -a.createdAt.localeCompare(b.createdAt));
|
||||
return res.status(200).json(posts);
|
||||
})
|
||||
.then(function() {
|
||||
@ -154,6 +156,7 @@ exports.getOtherUsersPosts = (req, res) => {
|
||||
myPosts.forEach(function(doc) {
|
||||
posts.push(doc.data());
|
||||
});
|
||||
posts.sort((a, b) => -a.createdAt.localeCompare(b.createdAt));
|
||||
return res.status(200).json(posts);
|
||||
})
|
||||
.then(function() {
|
||||
|
||||
@ -148,7 +148,7 @@ class Home extends Component {
|
||||
<Typography variant="body2">{post.body}</Typography>
|
||||
<br />
|
||||
<Typography variant="body2">
|
||||
<b>Topics:</b> {post.microBlogTopics}
|
||||
<b>Topics:</b> {post.microBlogTopics.join(", ")}
|
||||
</Typography>
|
||||
<br />
|
||||
<Typography
|
||||
|
||||
Loading…
Reference in New Issue
Block a user