fix: adjust admin user routes and sidebar deps

This commit is contained in:
Esdras Renan 2025-10-13 11:59:09 -03:00
parent 4951e82834
commit 076c0df7f9
3 changed files with 10 additions and 7 deletions

View file

@ -17,14 +17,15 @@ function generatePassword(length = 12) {
export const runtime = "nodejs"
export async function POST(request: Request, { params }: { params: { id: string } }) {
export async function POST(request: Request, { params }: { params: Promise<{ id: string }> }) {
const { id } = await params
const session = await assertAdminSession()
if (!session) {
return NextResponse.json({ error: "Não autorizado" }, { status: 401 })
}
const user = await prisma.authUser.findUnique({
where: { id: params.id },
where: { id },
select: { id: true, role: true },
})