fix: align next config with next 15.5.5
This commit is contained in:
parent
0cf1892256
commit
91d0608838
8 changed files with 642 additions and 510 deletions
|
|
@ -2,9 +2,9 @@ import { NextResponse } from "next/server"
|
|||
import { randomBytes } from "crypto"
|
||||
|
||||
import { prisma } from "@/lib/prisma"
|
||||
import { Prisma } from "@prisma/client"
|
||||
import { assertStaffSession } from "@/lib/auth-server"
|
||||
import { isAdmin } from "@/lib/authz"
|
||||
import { PrismaClientKnownRequestError } from "@prisma/client/runtime/library"
|
||||
|
||||
export const runtime = "nodejs"
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ export async function POST(request: Request) {
|
|||
return NextResponse.json({ company })
|
||||
} catch (error) {
|
||||
console.error("Failed to create company", error)
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError && error.code === "P2002") {
|
||||
if (error instanceof PrismaClientKnownRequestError && error.code === "P2002") {
|
||||
// Duplicidade de slug por tenant ou provisioningCode único
|
||||
return NextResponse.json(
|
||||
{ error: "Já existe uma empresa com este slug ou código de provisionamento." },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue