From ca8f786fb03a25a1a15b71a41f902b7a73be5afc Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Fri, 20 Mar 2026 13:07:11 -0700 Subject: [PATCH] Fix registration API to accept simplified name/email-only form - Update API route validation to only require name and email - Simplify RegistrationData interface - Keep sheet column layout unchanged for backward compatibility Co-Authored-By: Claude Opus 4.6 --- app/api/register/route.ts | 11 ++--------- lib/google-sheets.ts | 21 +++++++-------------- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/app/api/register/route.ts b/app/api/register/route.ts index cd3b78d..e554a61 100644 --- a/app/api/register/route.ts +++ b/app/api/register/route.ts @@ -5,10 +5,10 @@ export async function POST(request: NextRequest) { try { const body = await request.json() - const { name, email, contact, contributions, expectations, howHeard, dietary, crewConsent, wantFood } = body + const { name, email } = body // Validate required fields - if (!name || !email || !contact || !contributions || !expectations || !crewConsent) { + if (!name || !email) { return NextResponse.json( { error: "Missing required fields" }, { status: 400 } @@ -22,13 +22,6 @@ export async function POST(request: NextRequest) { const rowNumber = await addRegistration({ name, email, - contact, - contributions, - expectations, - howHeard: howHeard || "", - dietary: Array.isArray(dietary) ? dietary.join(", ") : dietary || "", - crewConsent, - wantFood: wantFood || false, }) console.log(`[Register API] Registration added for ${name} at row ${rowNumber}`) diff --git a/lib/google-sheets.ts b/lib/google-sheets.ts index be1f0ba..9557f7a 100644 --- a/lib/google-sheets.ts +++ b/lib/google-sheets.ts @@ -18,13 +18,6 @@ const SHEET_NAME = process.env.GOOGLE_SHEET_NAME || "Registrations" export interface RegistrationData { name: string email?: string - contact: string - contributions: string - expectations: string - howHeard: string - dietary: string - crewConsent: string - wantFood: boolean } export interface PaymentUpdateData { @@ -53,12 +46,12 @@ export async function addRegistration(data: RegistrationData): Promise { timestamp, // A: Timestamp data.name, // B: Name data.email || "", // C: Email - data.contact, // D: Contact - data.contributions, // E: Contributions - data.expectations, // F: Expectations - data.howHeard || "", // G: How Heard - data.dietary, // H: Dietary - data.crewConsent, // I: Crew Consent + "", // D: Contact (unused) + "", // E: Contributions (unused) + "", // F: Expectations (unused) + "", // G: How Heard (unused) + "", // H: Dietary (unused) + "", // I: Crew Consent (unused) "Pending", // J: Payment Status "", // K: Payment Method "", // L: Payment Session ID @@ -66,7 +59,7 @@ export async function addRegistration(data: RegistrationData): Promise { "", // N: Payment Date "", // O: Accommodation Venue "", // P: Accommodation Type - data.wantFood ? "Yes" : "No", // Q: Want Food + "", // Q: Want Food (unused) ], ]