Skip to content

Commit

Permalink
fix: fix prisma
Browse files Browse the repository at this point in the history
  • Loading branch information
achauve committed Dec 12, 2023
1 parent 0daee8b commit aa6731d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions formulaire/src/lib/prismaClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ declare global {
}

const getClient = () => {
if (process.env.NODE_ENV === "production") {
return new PrismaClient();
} else {
if (!global.prisma) global.prisma = new PrismaClient();
return global.prisma;
}
return new PrismaClient();
};

const client = getClient();
global.prisma = client;

export default client;

0 comments on commit aa6731d

Please sign in to comment.