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 comments = await Comment.find({ post: dbPost._id })
|
||||
.sort({
|
||||
field: "date",
|
||||
desc,
|
||||
date: -1,
|
||||
})
|
||||
.lean()
|
||||
.exec();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue