5d9df64849
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 lines
412 B
TypeScript
12 lines
412 B
TypeScript
const API_URL = process.env.API_URL ?? 'http://localhost:3001';
|
|
|
|
export async function DELETE(
|
|
_req: Request,
|
|
{ params }: { params: Promise<{ id: string }> },
|
|
) {
|
|
const { id } = await params;
|
|
const res = await fetch(`${API_URL}/routes/${id}`, { method: 'DELETE' });
|
|
if (res.status === 204) return new Response(null, { status: 204 });
|
|
return Response.json(await res.json(), { status: res.status });
|
|
}
|