feat: add prefilling pdf form fields via api

This commit is contained in:
Mythie
2024-04-08 17:01:11 +07:00
parent 48a8f5fe07
commit 08b693ff95
8 changed files with 128 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ export type CreateDocumentOptions = {
userId: number;
teamId?: number;
documentDataId: string;
formValues?: Record<string, string | number | boolean>;
requestMetadata?: RequestMetadata;
};
@@ -22,6 +23,7 @@ export const createDocument = async ({
title,
documentDataId,
teamId,
formValues,
requestMetadata,
}: CreateDocumentOptions) => {
const user = await prisma.user.findFirstOrThrow({
@@ -51,6 +53,7 @@ export const createDocument = async ({
documentDataId,
userId,
teamId,
formValues,
},
});