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

Commit

Permalink
Merge pull request #33 from telemark/datafilter
Browse files Browse the repository at this point in the history
Implements datefilter for messages (minor)
  • Loading branch information
zrrrzzt committed Nov 10, 2019
2 parents e0b3f75 + b35ed13 commit 805039b
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 805039b

Please sign in to comment.