wip: refresh design

This commit is contained in:
Mythie
2023-06-09 18:21:18 +10:00
parent 76b2fb5edd
commit 159bcade7b
432 changed files with 19640 additions and 29359 deletions

View File

@@ -1,16 +1,15 @@
import { isENVProd } from "@documenso/lib";
import { Document, PrismaClient, User } from "@prisma/client";
import { PrismaClient } from '@prisma/client';
declare global {
var client: PrismaClient | undefined;
// We need `var` to declare a global variable in TypeScript
// eslint-disable-next-line no-var
var prisma: PrismaClient | undefined;
}
// Instanciate new client if non exists
const prisma = globalThis.client || new PrismaClient();
// Save for reuse in dev environment to avoid many client instances in dev where restart and reloads
if (!isENVProd) {
globalThis.client = prisma;
if (!globalThis.prisma) {
globalThis.prisma = new PrismaClient();
}
export default prisma;
export const prisma = globalThis.prisma || new PrismaClient();
export const getPrismaClient = () => prisma;