Skip to content
This repository has been archived by the owner on Nov 5, 2020. It is now read-only.

Commit

Permalink
Implements datefilter for messages (minor)
Browse files Browse the repository at this point in the history
  • Loading branch information
zrrrzzt committed Nov 10, 2019
1 parent e0b3f75 commit b35ed13
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/messages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ module.exports = authMiddleware(async (req, res) => {
const usedRoles = roles ? roles.split('|') : req.user.roles
const usedLimit = limit + 1
const data = await Message.find({
date_to: {
$gte: new Date()
},
role: {
$in: usedRoles
},
Expand Down

0 comments on commit b35ed13

Please sign in to comment.