Closing registrations for ideathon - #58
Conversation
|
@Akshat-Raj is attempting to deploy a commit to the Genesis' projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Updates the site to reflect that Ideathon registrations are closed (alongside Clash Royale), affecting the hero banner copy, the registration page event list, and the registration API guardrail.
Changes:
- Update Hero banner text to announce Clash Royale + Ideathon registrations are closed.
- Hide Ideathon from the registration page’s event list.
- Add a server-side block in the
/api/registerendpoint intended to reject closed-event registrations.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/components/sections/Hero.tsx | Updates on-site messaging to announce closures. |
| src/app/register/page.tsx | Removes Ideathon from selectable registration events (commented out entry). |
| src/app/api/register/route.ts | Adds a server-side “registrations closed” check (currently incorrect for Ideathon). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (event === "clash_royale" || event === "Ideathon") { | ||
| return NextResponse.json({ error: "Registrations for Clash Royale are closed." }, { status: 400 }); |
There was a problem hiding this comment.
The API is checking event === "Ideathon", but the registration payload sends the event ID (e.g. "pitch_perfect" for Ideathon per EVENT_NAMES / formConstants). This means Ideathon registrations are not actually blocked server-side. Update this condition to check the correct event ID ("pitch_perfect") and adjust the error message to reflect whichever event is closed (Clash Royale vs Ideathon).
| if (event === "clash_royale" || event === "Ideathon") { | |
| return NextResponse.json({ error: "Registrations for Clash Royale are closed." }, { status: 400 }); | |
| const closedEventNames: Record<string, string> = { | |
| clash_royale: "Clash Royale", | |
| pitch_perfect: EVENT_NAMES.pitch_perfect, | |
| }; | |
| if (event in closedEventNames) { | |
| return NextResponse.json( | |
| { error: `Registrations for ${closedEventNames[event]} are closed.` }, | |
| { status: 400 } | |
| ); |
No description provided.