.
This commit is contained in:
@@ -7,8 +7,13 @@ type Params = { params: Promise<{ id: string }> }
|
||||
export async function GET(_request: NextRequest, { params }: Params) {
|
||||
try {
|
||||
const { id } = await params
|
||||
const business = await prisma.business.findUnique({
|
||||
where: { id },
|
||||
const business = await prisma.business.findFirst({
|
||||
where: {
|
||||
OR: [
|
||||
{ id: id },
|
||||
{ slug: id }
|
||||
]
|
||||
},
|
||||
include: { owner: true, offers: true },
|
||||
})
|
||||
if (!business) return NextResponse.json({ error: 'Non trouvé' }, { status: 404 })
|
||||
|
||||
Reference in New Issue
Block a user