Skip to content

Commit

Permalink
feat: Change http status code on error (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
vcapretz authored May 13, 2024
1 parent 6f89c33 commit 59620f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/api/send/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
}

0 comments on commit 59620f7

Please sign in to comment.