mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2026-03-10 13:15:05 +00:00
Merge pull request #110 from ClaytonWWilson/chronological
can sort posts chronologically in userline and formatted topics listi…
This commit is contained in:
@@ -46,8 +46,10 @@ exports.getallPostsforUser = (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() {
|
||||
return res
|
||||
.status(200)
|
||||
|
||||
Reference in New Issue
Block a user