feat: alerts api (create/delete)
This commit is contained in:
9
src/app/api/alerts/[id]/route.ts
Normal file
9
src/app/api/alerts/[id]/route.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { eq } from 'drizzle-orm'
|
||||
import { db, alerts } from '@/lib/db'
|
||||
|
||||
export async function DELETE(_req: NextRequest, { params }: { params: Promise<{ id: string }> }) {
|
||||
const { id } = await params
|
||||
await db.delete(alerts).where(eq(alerts.id, id))
|
||||
return NextResponse.json({ ok: true })
|
||||
}
|
||||
Reference in New Issue
Block a user