Update application code and dependencies
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { prisma } from "@/app/lib/prisma"
|
||||
import { NextResponse } from "next/server"
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
{ params }: { params: Promise<{ slug: string }> }
|
||||
) {
|
||||
const { slug } = await params
|
||||
const agent = await prisma.agent.findUnique({
|
||||
where: { slug },
|
||||
include: { category: true },
|
||||
})
|
||||
|
||||
if (!agent) {
|
||||
return NextResponse.json({ error: "Agent not found" }, { status: 404 })
|
||||
}
|
||||
|
||||
return NextResponse.json(agent)
|
||||
}
|
||||
Reference in New Issue
Block a user