mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +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:
@ -8,6 +8,7 @@ import {
|
||||
ZDocumentActionAuthTypesSchema,
|
||||
} from '@documenso/lib/types/document-auth';
|
||||
import { ZDocumentEmailSettingsSchema } from '@documenso/lib/types/document-email';
|
||||
import AttachmentSchema from '@documenso/prisma/generated/zod/modelSchema/AttachmentSchema';
|
||||
|
||||
import type { TrpcRouteMeta } from '../trpc';
|
||||
import {
|
||||
@ -45,6 +46,13 @@ export const ZUpdateDocumentRequestSchema = z.object({
|
||||
globalAccessAuth: ZDocumentAccessAuthTypesSchema.nullish(),
|
||||
globalActionAuth: ZDocumentActionAuthTypesSchema.nullish(),
|
||||
useLegacyFieldInsertion: z.boolean().optional(),
|
||||
attachments: AttachmentSchema.pick({
|
||||
id: true,
|
||||
label: true,
|
||||
url: true,
|
||||
})
|
||||
.array()
|
||||
.optional(),
|
||||
})
|
||||
.optional(),
|
||||
meta: z
|
||||
|
||||
Reference in New Issue
Block a user