feat: add admin dashboard and core API routes with Docker configuration
This commit is contained in:
@@ -1,17 +1,20 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import prisma from '@/lib/prisma';
|
||||
import { getAuthUser } from '@/lib/auth-utils';
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
context: { params: Promise<{ id: string }> }
|
||||
) {
|
||||
const { id: paramId } = await context.params;
|
||||
const userId = req.headers.get('x-user-id');
|
||||
const authUser = await getAuthUser(req);
|
||||
|
||||
if (!userId) {
|
||||
if (!authUser) {
|
||||
return NextResponse.json({ rating: null });
|
||||
}
|
||||
|
||||
const userId = authUser.id;
|
||||
|
||||
try {
|
||||
// Resolve actual Business UUID if paramId is a slug
|
||||
const business = await prisma.business.findFirst({
|
||||
|
||||
Reference in New Issue
Block a user