Skip to content
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

Merged
merged 25 commits into from
Nov 30, 2023
Merged

Past activities el #62

merged 25 commits into from
Nov 30, 2023

Conversation

ellieliiii
Copy link
Collaborator

replaced fake past activities with real data. limited showing to 5 events. added show more button that leads to volunteerHistory page.

Screen Shot 2023-11-11 at 16 30 10 Screen Shot 2023-11-11 at 16 30 18

Copy link

vercel bot commented Nov 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
bookem-user ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 30, 2023 2:23am

Copy link
Collaborator

@JiashuHarryHuang JiashuHarryHuang left a 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.


useEffect(() => {
// Assuming your API endpoint for past activities is '/api/pastActivities'
fetch('/api/events/past')
Copy link
Collaborator

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

const events = await VolunteerEvents.find({
endDate: { $lt: new Date() },
}).sort({ endDate: 1 });
return res.status(200).json(events.slice(0, 5));
Copy link
Collaborator

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
Copy link
Collaborator

@JiashuHarryHuang JiashuHarryHuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@JiashuHarryHuang JiashuHarryHuang merged commit 5d4d981 into main Nov 30, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Past Acitivities in Bookem User
2 participants