3aaa1cde0d
* use sanitize-html instead
* add list formatting
* add lost changes from merging main
* fixes caused by merge
* remove dompurify
* Revert "remove dompurify"
This reverts commit 583bb623c7
.
* sanitize already done in editor
* Update yarn.lock
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
29 lines
817 B
TypeScript
29 lines
817 B
TypeScript
import type { Prisma } from "@prisma/client";
|
|
import { PrismaClient } from "@prisma/client";
|
|
|
|
import { bookingReferenceMiddleware } from "./middleware";
|
|
|
|
declare global {
|
|
// eslint-disable-next-line no-var
|
|
var prisma: PrismaClient | undefined;
|
|
}
|
|
|
|
const prismaOptions: Prisma.PrismaClientOptions = {};
|
|
|
|
if (!!process.env.NEXT_PUBLIC_DEBUG) prismaOptions.log = ["query", "error", "warn"];
|
|
|
|
export const prisma = globalThis.prisma || new PrismaClient(prismaOptions);
|
|
|
|
export const customPrisma = (options: Prisma.PrismaClientOptions) =>
|
|
new PrismaClient({ ...prismaOptions, ...options });
|
|
|
|
if (process.env.NODE_ENV !== "production") {
|
|
globalThis.prisma = prisma;
|
|
}
|
|
// If any changed on middleware server restart is required
|
|
bookingReferenceMiddleware(prisma);
|
|
|
|
export default prisma;
|
|
|
|
export * from "./selects";
|