src/app/api/submit-form/route.tsimport { studioUrl } from '@/utils/studio-helpers'import { NextResponse } from 'next/server'export const runtime = 'nodejs'function encodeFormData(data: Record<string, any>) {const fd = new FormData()for (const [k, v] of Object.entries(data)) {if (Array.isArray(v)) for (const item of v) fd.append(k, item as any)else if (v !== undefined && v !== null) fd.append(k, v as any)}return fd}function escapeHtml(s: string) {return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"')
Showing the first 20 lines.
Get full code