From 0f6a606801ec2144ac605fd7201da0ff8fe361e4 Mon Sep 17 00:00:00 2001 From: UltraLionFr Date: Wed, 20 Aug 2025 18:53:15 +0200 Subject: [PATCH] update --- app/api/paste/[id]/route.ts | 2 +- app/api/user-pastes/route.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/api/paste/[id]/route.ts b/app/api/paste/[id]/route.ts index 23bf75f..f7f112c 100644 --- a/app/api/paste/[id]/route.ts +++ b/app/api/paste/[id]/route.ts @@ -10,7 +10,7 @@ export async function GET( request: NextRequest, context: { params: Promise<{ id: string }> } ) { - const { id: pasteId } = await context.params; // ✅ await obligatoire + const { id: pasteId } = await context.params; if (!pasteId) { return NextResponse.json({ error: 'Invalid ID' }, { status: 400 }); diff --git a/app/api/user-pastes/route.ts b/app/api/user-pastes/route.ts index 7b6b84a..65ff66b 100644 --- a/app/api/user-pastes/route.ts +++ b/app/api/user-pastes/route.ts @@ -1,5 +1,6 @@ import { authOptions } from '@/lib/auth'; import { prisma } from '@/lib/prisma'; +import { Prisma } from '@prisma/client'; import { getServerSession } from 'next-auth'; import { NextResponse } from 'next/server'; @@ -23,7 +24,7 @@ export async function GET(req: Request) { ? { title: { contains: search, - mode: 'insensitive', + mode: Prisma.QueryMode.insensitive, }, } : {}), @@ -42,4 +43,4 @@ export async function GET(req: Request) { ]); return NextResponse.json({ pastes, total }); -} +} \ No newline at end of file