Skip to content

Closing day 1 event registrations - #63

Merged
Akshat-Raj merged 1 commit into
Genesis-ISE-DSCE:mainfrom
Akshat-Raj:main
Apr 17, 2026
Merged

Closing day 1 event registrations#63
Akshat-Raj merged 1 commit into
Genesis-ISE-DSCE:mainfrom
Akshat-Raj:main

Conversation

@Akshat-Raj

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings April 17, 2026 15:04
@vercel

vercel Bot commented Apr 17, 2026

Copy link
Copy Markdown

@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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR closes registrations for selected Day 1 events by removing them from the public registration UI and rejecting attempts via the registration API.

Changes:

  • Hid “Ideathon” (pitch_perfect) and “Technoseek” from the public registration event list.
  • Updated the /api/register POST handler to reject registrations for clash_royale, pitch_perfect, and technoseek.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/app/register/page.tsx Removes closed events from the UI by commenting out their ALL_EVENTS entries.
src/app/api/register/route.ts Blocks registrations for the closed event IDs with a 400 error response.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +50 to +51
if (event === "clash_royale" || event === "pitch_perfect" || event === "technoseek") {
return NextResponse.json({ error: "Registrations for Clash Royale, Ideathon, and Technoseek are closed." }, { status: 400 });

Copilot AI Apr 17, 2026

Copy link

Choose a reason for hiding this comment

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

The closed-registration response always lists multiple events ("Clash Royale, Ideathon, and Technoseek") even when the user attempted to register for only one of them, which can be confusing. Consider returning an event-specific message (e.g., derive the display name from EVENT_NAMES / EVENT_LABELS based on the requested event) while still keeping the status code 400.

Copilot uses AI. Check for mistakes.
Comment on lines 47 to 52
const body = await req.json();
const { event, team_name, member1, member2, member3 } = body;

if (event === "clash_royale") {
return NextResponse.json({ error: "Registrations for Clash Royale are closed." }, { status: 400 });
if (event === "clash_royale" || event === "pitch_perfect" || event === "technoseek") {
return NextResponse.json({ error: "Registrations for Clash Royale, Ideathon, and Technoseek are closed." }, { status: 400 });
}

Copilot AI Apr 17, 2026

Copy link

Choose a reason for hiding this comment

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

The API currently only checks for presence of event, but does not validate that it is a supported event ID (or even a string). For unknown/invalid values, this will fall through to Participant.create() and rely on Mongoose enum validation, which turns a client input error into a 500. Consider normalizing (String(event).trim()) and validating against a single source of truth (e.g., EVENT_IDS from src/lib/formConstants.ts or the Participant enum) and returning a 400 for invalid events before the closed-events check.

Copilot uses AI. Check for mistakes.
@Akshat-Raj
Akshat-Raj merged commit 7037a3b into Genesis-ISE-DSCE:main Apr 17, 2026
5 of 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.

2 participants