mirror of
https://github.com/documenso/documenso.git
synced 2026-07-09 20:45:00 +10:00
f9cb8d84ed
Resolved conflicts:
- create-document-data.ts: merged initialData + originalData/originalMimeType
- files.helpers.ts: kept both imports
- envelope-drop-zone-wrapper.tsx: adopted buildDropzoneRejectionDescription
- create-envelope-items.ts: adopted UNSAFE_createEnvelopeItems
- create-envelope.ts: integrated convertToPdfIfNeeded into createEnvelopeRouteCaller
Extended putPdfFileServerSide to accept { initialData, originalData,
originalMimeType } options; updated seal-document.handler call site.
36 lines
729 B
TypeScript
36 lines
729 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;
|
|
originalData?: string;
|
|
originalMimeType?: string;
|
|
};
|
|
|
|
export const createDocumentData = async ({
|
|
type,
|
|
data,
|
|
initialData,
|
|
originalData,
|
|
originalMimeType,
|
|
}: CreateDocumentDataOptions) => {
|
|
return await prisma.documentData.create({
|
|
data: {
|
|
type,
|
|
data,
|
|
initialData: initialData || data,
|
|
originalData,
|
|
originalMimeType,
|
|
},
|
|
});
|
|
};
|