fix(api): prevent self-loop routes, map P2003 to 400, forward DELETE error body
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,5 +6,6 @@ export async function DELETE(
|
||||
) {
|
||||
const { id } = await params;
|
||||
const res = await fetch(`${API_URL}/routes/${id}`, { method: 'DELETE' });
|
||||
return new Response(null, { status: res.status });
|
||||
if (res.status === 204) return new Response(null, { status: 204 });
|
||||
return Response.json(await res.json(), { status: res.status });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user