mirror of
https://github.com/documenso/documenso.git
synced 2025-11-17 18:21:32 +10:00
feat: enhance document management by adding attachments support
- Updated DocumentEditForm to include attachments in the document data. - Modified getDocumentWithDetailsById to fetch attachments. - Updated ZDocumentSchema to validate attachments. - Enhanced AddSettingsFormPartial to handle attachments with default values and updated field names.
This commit is contained in:
@ -27,6 +27,7 @@ export const getDocumentWithDetailsById = async ({
|
||||
documentMeta: true,
|
||||
recipients: true,
|
||||
fields: true,
|
||||
attachments: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import type { z } from 'zod';
|
||||
|
||||
import { AttachmentSchema } from '@documenso/prisma/generated/zod/modelSchema/AttachmentSchema';
|
||||
import { DocumentDataSchema } from '@documenso/prisma/generated/zod/modelSchema/DocumentDataSchema';
|
||||
import { DocumentMetaSchema } from '@documenso/prisma/generated/zod/modelSchema/DocumentMetaSchema';
|
||||
import { DocumentSchema } from '@documenso/prisma/generated/zod/modelSchema/DocumentSchema';
|
||||
@ -59,6 +60,7 @@ export const ZDocumentSchema = DocumentSchema.pick({
|
||||
}).nullable(),
|
||||
recipients: ZRecipientLiteSchema.array(),
|
||||
fields: ZFieldSchema.array(),
|
||||
attachments: AttachmentSchema.array(),
|
||||
});
|
||||
|
||||
export type TDocument = z.infer<typeof ZDocumentSchema>;
|
||||
|
||||
Reference in New Issue
Block a user