Skip to content

Commit

Permalink
fix typo - should use startDate not eventDate
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidHuang2002 authored and JiashuHarryHuang committed Nov 12, 2023
1 parent df2ba2f commit 5bd8e86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pages/api/events/explore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export default async function handler(
try {
await dbConnect();

// Select all events where eventDate > today order by progamDate ascending
// Select all events where startDate > today order by progamDate ascending
const events = await VolunteerEvents.find({
eventDate: { $gt: new Date() },
}).sort({ eventDate: 1 });
startDate: { $gt: new Date() },
}).sort({ startDate: 1 });

return res.status(200).json(events);
} catch (error) {
Expand Down
4 changes: 2 additions & 2 deletions pages/api/events/upcoming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export default async function handler(
// Use the user's events array to filter the VolunteerEvents
const events = await VolunteerEvents.find({
_id: { $in: user.events },
eventDate: { $gt: new Date() },
}).sort({ eventDate: 1 });
startDate: { $gt: new Date() },
}).sort({ startDate: 1 });

return res.status(200).json(events);
} catch (error) {
Expand Down

0 comments on commit 5bd8e86

Please sign in to comment.