update user-pastes

This commit is contained in:
UltraLionFr
2025-08-20 18:26:27 +02:00
parent 8b4355518e
commit 15e557d0b8
2 changed files with 4 additions and 6 deletions
+2 -4
View File
@@ -1,6 +1,5 @@
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';
@@ -18,14 +17,13 @@ export async function GET(req: Request) {
const search = searchParams.get('q') || '';
// ✅ Typage explicite avec Prisma
const filter: Prisma.PasteWhereInput = {
const filter = {
createdBy: session.user.id,
...(search
? {
title: {
contains: search,
mode: 'insensitive', // correspond au type Prisma.QueryMode
mode: 'insensitive',
},
}
: {}),
+1 -1
View File
@@ -10,7 +10,7 @@
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node", // ✅ change "bundler" en "node"
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,