-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Past activities el #62
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address the comments I made.
components/Home/PastActivity.tsx
Outdated
|
||
useEffect(() => { | ||
// Assuming your API endpoint for past activities is '/api/pastActivities' | ||
fetch('/api/events/past') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use fetchData() helper function. Refer to pages/event/[pid].tsx
pages/api/events/past.ts
Outdated
const events = await VolunteerEvents.find({ | ||
endDate: { $lt: new Date() }, | ||
}).sort({ endDate: 1 }); | ||
return res.status(200).json(events.slice(0, 5)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just get five rather than getting all events and choose five. Use the .limit()
method.
…equest, tested volunteer history page. -tb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
replaced fake past activities with real data. limited showing to 5 events. added show more button that leads to volunteerHistory page.