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

Try to redirect /events/[monthWithNoEvent] to nearest future month with event #676

Merged
merged 3 commits into from
Feb 6, 2025

Conversation

sruenwg
Copy link
Collaborator

@sruenwg sruenwg commented Feb 5, 2025

Fixes #642.

I went with option 1 described in #642, so if /events/[yearMonth] has no events, instead of showing a 404:

  • The user is redirected to the month with the next upcoming event.
  • If there is no such month after the queried month, the user is redirected to the last month prior to the queried month which had an event.
  • A 404 is only shown when there are no events at all which could be fetched.

Tests

If the queried month has no event but there is an event in a future month, redirect to the closest future month with an event:

vspodule-no-event-month-redirect-future.mov

If the queried month has no event and there is an event only in a past month, redirect to the last month with an event:

vspodule-no-event-month-redirect-past.mov

If the queried month has an event, perform no redirect:

vspodule-no-event-month-redirect-present.mov

If fetched events list is empty, show 404:

vspodule-no-event-month-redirect-none.mov

@sruenwg sruenwg requested a review from sugar-cat7 as a code owner February 5, 2025 06:46
Copy link

vercel bot commented Feb 5, 2025

@sruenwg is attempting to deploy a commit to the sugar-cat7's Team Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Feb 6, 2025

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

Name Status Preview Updated (UTC)
vspo-schedule ✅ Ready (Inspect) Visit Preview Feb 6, 2025 11:53am

Copy link
Owner

@sugar-cat7 sugar-cat7 left a comment

Choose a reason for hiding this comment

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

Thankyou🙏

@sruenwg sruenwg merged commit 9d8bce0 into sugar-cat7:main Feb 6, 2025
4 checks passed
@sruenwg sruenwg deleted the fix-no-event-month branch February 6, 2025 21:47
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.

🐛 BUG: Events button in bottom nav leads to 404 page when current month has no events
2 participants