Merge b059abf46d into 238750c025
This commit is contained in:
commit
3a6a7446ca
|
|
@ -16,7 +16,12 @@ export async function POST(request: NextRequest) {
|
|||
return NextResponse.json({ error: "Too many requests" }, { status: 429 });
|
||||
}
|
||||
|
||||
const body = await request.json();
|
||||
let body: unknown;
|
||||
try {
|
||||
body = await request.json();
|
||||
} catch {
|
||||
return NextResponse.json({ error: "Invalid JSON" }, { status: 400 });
|
||||
}
|
||||
const result = submitSchema.safeParse(body);
|
||||
|
||||
if (!result.success) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue