add client/admin pages, show info and created admin api and server actions
This commit is contained in:
10
app/api/admin/route.ts
Normal file
10
app/api/admin/route.ts
Normal 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 })
|
||||
}
|
||||
Reference in New Issue
Block a user