瀏覽代碼

properly search for records

Matthew Trejo 6 天之前
父節點
當前提交
497b0eb8a8
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/app/api/chat/report/route.ts

+ 2 - 1
src/app/api/chat/report/route.ts

@@ -2,6 +2,7 @@ import { NextRequest, NextResponse } from "next/server"
 import { getServerSession } from "next-auth"
 import { authOptions } from "@/lib/auth"
 import { prisma } from "@/lib/prisma"
+import { Prisma } from "@prisma/client"
 
 export async function POST(request: NextRequest) {
   try {
@@ -84,7 +85,7 @@ export async function GET(request: NextRequest) {
     const userId = searchParams.get("userId")
 
     // Construir la condición where según el rol
-    const whereClause: { userId?: string; chatType?: any } = {}
+    const whereClause: Prisma.RecordWhereInput = {}
 
     if (session.user.role === "ADMIN") {
       // Los admins pueden ver todos los reportes o filtrar por usuario específico