From 6dac5b09c09a6ad7f858a5513c119e7e4fd7da4b Mon Sep 17 00:00:00 2001 From: UltraLionFr Date: Wed, 20 Aug 2025 19:34:35 +0200 Subject: [PATCH] update prisma --- app/api/user-pastes/route.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/api/user-pastes/route.ts b/app/api/user-pastes/route.ts index d47e8ec..a4a843f 100644 --- a/app/api/user-pastes/route.ts +++ b/app/api/user-pastes/route.ts @@ -1,6 +1,5 @@ import { authOptions } from '@/lib/auth'; import { prisma } from '@/lib/prisma'; -import type { Prisma } from '@prisma/client'; import { getServerSession } from 'next-auth'; import { NextResponse } from 'next/server'; @@ -18,13 +17,13 @@ export async function GET(req: Request) { const search = searchParams.get('q') || ''; - const filter: Prisma.PasteWhereInput = { + const filter = { createdBy: session.user.id, ...(search ? { title: { contains: search, - mode: 'insensitive' as Prisma.QueryMode, + mode: 'insensitive' as const, }, } : {}),