add client/admin pages, show info and created admin api and server actions

This commit is contained in:
2024-04-28 19:32:31 +03:00
parent db66161d81
commit d6b259d71c
33 changed files with 458 additions and 91 deletions

10
app/api/admin/route.ts Normal file
View File

@@ -0,0 +1,10 @@
import { NextResponse } from 'next/server'
import { currentRole } from '@/lib/auth'
import { UserRole } from '@prisma/client'
export async function GET () {
const role = await currentRole()
const status: number = role === UserRole.ADMIN ? 200 : 403
return new NextResponse(null, { status })
}