update user-pastes
This commit is contained in:
@@ -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
@@ -10,7 +10,7 @@
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node", // ✅ change "bundler" en "node"
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
|
||||
Reference in New Issue
Block a user