fixed sorting function
This commit is contained in:
parent
ad5123f10a
commit
b27395697b
1 changed files with 1 additions and 2 deletions
|
|
@ -97,8 +97,7 @@ exports.get = asyncHandler(async (req, res, next) => {
|
||||||
const dbPost = await Post.findById(req.params.postID).lean().exec();
|
const dbPost = await Post.findById(req.params.postID).lean().exec();
|
||||||
const comments = await Comment.find({ post: dbPost._id })
|
const comments = await Comment.find({ post: dbPost._id })
|
||||||
.sort({
|
.sort({
|
||||||
field: "date",
|
date: -1,
|
||||||
desc,
|
|
||||||
})
|
})
|
||||||
.lean()
|
.lean()
|
||||||
.exec();
|
.exec();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue