mirror of
https://github.com/documenso/documenso
synced 2026-04-21 13:27:18 +00:00
## Description Replace the PDF renderer with an custom image renderer. This allows us to remove the "react-pdf" dependency and allows us to use a virtual list to improve performance.
29 lines
595 B
TypeScript
29 lines
595 B
TypeScript
import type { DocumentDataType } from '@prisma/client';
|
|
|
|
import { prisma } from '@documenso/prisma';
|
|
|
|
export type CreateDocumentDataOptions = {
|
|
type: DocumentDataType;
|
|
data: string;
|
|
|
|
/**
|
|
* The initial data that was used to create the document data.
|
|
*
|
|
* If not provided, the current data will be used.
|
|
*/
|
|
initialData?: string;
|
|
};
|
|
|
|
export const createDocumentData = async ({
|
|
type,
|
|
data,
|
|
initialData,
|
|
}: CreateDocumentDataOptions) => {
|
|
return await prisma.documentData.create({
|
|
data: {
|
|
type,
|
|
data,
|
|
initialData: initialData || data,
|
|
},
|
|
});
|
|
};
|