15 lines
380 B
TypeScript
15 lines
380 B
TypeScript
import { NextResponse } from "next/server";
|
|
import { prisma } from "@/lib/db";
|
|
|
|
export async function DELETE(
|
|
_req: Request,
|
|
{ params }: { params: { id: string } }
|
|
) {
|
|
try {
|
|
await prisma.block.delete({ where: { id: params.id } });
|
|
return NextResponse.json({ ok: true });
|
|
} catch {
|
|
return NextResponse.json({ error: "Nicht gefunden." }, { status: 404 });
|
|
}
|
|
}
|