Skip to content

Commit

Permalink
fix date comparison bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmadalaa committed May 20, 2024
1 parent d8f6b5a commit f5c4840
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controllers/questionController.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ exports.reteriveChat = catchAsync(async (req, res) => {

const questions = await Question.find({
chat_id: chat.chat._id,
createdAt: { $lte: req.query.createdOnBefore || Date.now() },
createdAt: { $lt: req.query.createdOnBefore || Date.now() },
})
.limit(req.query.limit * 1 || 10)
.select('-_id -__v -chat_id')
Expand Down

0 comments on commit f5c4840

Please sign in to comment.