From 59620f78a51bea290871cf2ccdbfe17f2b8b7328 Mon Sep 17 00:00:00 2001 From: Vitor Capretz Date: Sun, 12 May 2024 20:40:50 -0500 Subject: [PATCH] feat: Change http status code on error (#34) --- app/api/send/route.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/send/route.ts b/app/api/send/route.ts index 16952de..1b0812c 100644 --- a/app/api/send/route.ts +++ b/app/api/send/route.ts @@ -14,11 +14,11 @@ export async function POST() { }); if (error) { - return Response.json({ error }); + return Response.json({ error }, { status: 500 }); } return Response.json({ data }); } catch (error) { - return Response.json({ error }); + return Response.json({ error }, { status: 500 }); } }