Fix form submission

This commit is contained in:
David Hill
2025-10-29 15:34:39 +00:00
parent 7baa751351
commit 0fbedc5e19

View File

@@ -3,7 +3,6 @@ import { AWS } from "@opencode-ai/console-core/aws.js"
interface EnterpriseFormData { interface EnterpriseFormData {
name: string name: string
company: string
role: string role: string
email: string email: string
message: string message: string
@@ -14,7 +13,7 @@ export async function POST(event: APIEvent) {
const body = (await event.request.json()) as EnterpriseFormData const body = (await event.request.json()) as EnterpriseFormData
// Validate required fields // Validate required fields
if (!body.name || !body.company || !body.role || !body.email || !body.message) { if (!body.name || !body.role || !body.email || !body.message) {
return Response.json({ error: "All fields are required" }, { status: 400 }) return Response.json({ error: "All fields are required" }, { status: 400 })
} }
@@ -29,7 +28,6 @@ export async function POST(event: APIEvent) {
New Enterprise Inquiry New Enterprise Inquiry
Name: ${body.name} Name: ${body.name}
Company: ${body.company}
Role: ${body.role} Role: ${body.role}
Email: ${body.email} Email: ${body.email}
@@ -40,7 +38,7 @@ ${body.message}
// Send email using AWS SES // Send email using AWS SES
await AWS.sendEmail({ await AWS.sendEmail({
to: "enterprise@opencode.ai", to: "enterprise@opencode.ai",
subject: `Enterprise Inquiry from ${body.company}`, subject: `Enterprise Inquiry from ${body.name}`,
body: emailContent, body: emailContent,
}) })