Skip to content

Commit

Permalink
Make schedule API route inclusive of start and end times
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanRodgers98 committed May 22, 2021
1 parent 8796c34 commit 241be6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions server/routes/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,8 @@ router.get('/:eventId/scheduled-streams', async (req, res, next) => {

const filter = {
eventStage: {$in: event.stages.map(stage => stage._id)},
startTime: {$lt: req.query.scheduleEndTime},
endTime: {$gt: req.query.scheduleStartTime}
startTime: {$lte: req.query.scheduleEndTime},
endTime: {$gte: req.query.scheduleStartTime}
};

let scheduledStreams;
Expand Down
4 changes: 2 additions & 2 deletions server/routes/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -756,8 +756,8 @@ router.get('/:username/schedule', async (req, res, next) => {
{_id: {$in: user.nonSubscribedScheduledStreams}},
{eventStage: {$in: eventStageIds}}
],
startTime: {$lt: req.query.scheduleEndTime},
endTime: {$gt: req.query.scheduleStartTime}
startTime: {$lte: req.query.scheduleEndTime},
endTime: {$gte: req.query.scheduleStartTime}
})
.select('user eventStage title startTime endTime genre category')
.populate({
Expand Down

0 comments on commit 241be6d

Please sign in to comment.