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:
Catalin Documenso
2025-04-29 15:14:58 +03:00
parent 396a7db587
commit e3f8e76e6a
6 changed files with 47 additions and 7 deletions

View File

@ -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>;