mirror of
https://github.com/documenso/documenso.git
synced 2025-11-16 01:32:06 +10:00
feat: enhance document schema and update attachment handling
- Added attachments support to ZCreateDocumentMutationSchema and ZUpdateDocumentRequestSchema. - Updated ZDocumentSchema to validate attachments with specific fields. - Modified updateDocument function to handle attachment creation and deletion. - Enhanced AddSettingsFormSchema to include attachments with proper validation.
This commit is contained in:
@ -60,7 +60,14 @@ export const ZDocumentSchema = DocumentSchema.pick({
|
||||
}).nullable(),
|
||||
recipients: ZRecipientLiteSchema.array(),
|
||||
fields: ZFieldSchema.array(),
|
||||
attachments: AttachmentSchema.array(),
|
||||
attachments: AttachmentSchema.pick({
|
||||
id: true,
|
||||
type: true,
|
||||
label: true,
|
||||
url: true,
|
||||
})
|
||||
.array()
|
||||
.optional(),
|
||||
});
|
||||
|
||||
export type TDocument = z.infer<typeof ZDocumentSchema>;
|
||||
|
||||
Reference in New Issue
Block a user