diff --git a/functions/handlers/post.js b/functions/handlers/post.js
index 3fedee9..fbe8436 100644
--- a/functions/handlers/post.js
+++ b/functions/handlers/post.js
@@ -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() {
diff --git a/twistter-frontend/src/pages/Home.js b/twistter-frontend/src/pages/Home.js
index 3f47289..86d362a 100644
--- a/twistter-frontend/src/pages/Home.js
+++ b/twistter-frontend/src/pages/Home.js
@@ -148,7 +148,7 @@ class Home extends Component {
{post.body}
- Topics: {post.microBlogTopics}
+ Topics: {post.microBlogTopics.join(", ")}