refactor: align routes with next 16 and local fonts

This commit is contained in:
Esdras Renan 2025-10-22 02:08:18 -03:00
parent 2e3b46a7b5
commit dad84d7d0e
16 changed files with 2448 additions and 198 deletions

View file

@ -1,2 +1,2 @@
export { runtime } from "../users/route"
export const runtime = "nodejs"
export { GET, DELETE } from "../users/route"

View file

@ -1,5 +1,6 @@
import { NextResponse } from "next/server"
import { ZodError } from "zod"
import { Prisma } from "@prisma/client"
import { PrismaClientKnownRequestError } from "@prisma/client/runtime/library"
import { prisma } from "@/lib/prisma"
@ -142,7 +143,7 @@ export async function DELETE(
}
try {
const result = await prisma.$transaction(async (tx) => {
const result = await prisma.$transaction(async (tx: Prisma.TransactionClient) => {
const users = await tx.user.updateMany({
where: { companyId: company.id, tenantId: company.tenantId },
data: { companyId: null },

View file

@ -1,5 +1,4 @@
import { NextResponse } from "next/server"
import { Prisma } from "@prisma/client"
import { ConvexHttpClient } from "convex/browser"
@ -124,14 +123,14 @@ export async function PATCH(request: Request, context: { params: Promise<{ id: s
},
})
const event = await prisma.authInviteEvent.create({
data: {
inviteId: invite.id,
type: "revoked",
payload: reason ? { reason } : Prisma.JsonNull,
actorId: session.user.id ?? null,
},
})
const event = await prisma.authInviteEvent.create({
data: {
inviteId: invite.id,
type: "revoked",
payload: reason ? { reason } : Prisma.JsonNull,
actorId: session.user.id ?? null,
},
})
const normalized = normalizeInvite({ ...updated, events: [...invite.events, event] }, now)
await syncInvite(normalized)