carnet route
This commit is contained in:
parent
580cc20c5c
commit
605a2863f2
@ -4,14 +4,7 @@ import { authOptions } from '@/app/api/auth/[...nextauth]/route';
|
|||||||
import { DOMParser } from '@xmldom/xmldom';
|
import { DOMParser } from '@xmldom/xmldom';
|
||||||
import { Buffer } from 'buffer';
|
import { Buffer } from 'buffer';
|
||||||
import { PrismaClient } from '@prisma/client';
|
import { PrismaClient } from '@prisma/client';
|
||||||
|
import { prisma } from '@/lib/prisma';
|
||||||
// Use a single PrismaClient instance
|
|
||||||
declare global {
|
|
||||||
var prisma: PrismaClient | undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
const prisma = global.prisma || new PrismaClient();
|
|
||||||
if (process.env.NODE_ENV !== 'production') global.prisma = prisma;
|
|
||||||
|
|
||||||
// Cache for folder structure and credentials
|
// Cache for folder structure and credentials
|
||||||
const folderCache = new Map<string, { folders: string[]; timestamp: number }>();
|
const folderCache = new Map<string, { folders: string[]; timestamp: number }>();
|
||||||
|
|||||||
@ -18,6 +18,6 @@ export const prisma =
|
|||||||
log: ['query'],
|
log: ['query'],
|
||||||
})
|
})
|
||||||
|
|
||||||
if (env.NODE_ENV !== 'production') {
|
if (process.env.NODE_ENV !== 'production') {
|
||||||
globalForPrisma.prisma = prisma;
|
globalForPrisma.prisma = prisma;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user