This commit is contained in:
2026-04-11 23:30:14 +02:00
parent 10ca8c3e8c
commit b73939d381
1574 changed files with 621 additions and 57974 deletions

View File

@@ -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 })