diff --git a/src/components/purchase/PurchaseSchema.jsx b/src/components/purchase/PurchaseSchema.jsx index 9322bdc5..2656fa58 100644 --- a/src/components/purchase/PurchaseSchema.jsx +++ b/src/components/purchase/PurchaseSchema.jsx @@ -180,7 +180,12 @@ export const DeliveryChallanSchema = z.object({ invoiceAttachmentTypeId: z.string().nullable(), deliveryChallanDate: z.string().min(1, { message: "Deliver date required" }), description: z.string().min(1, { message: "Description required" }), - attachment: z.object(SingleAttachmentSchema.shape).nullable(), + attachment: z.any().refine( + (val) => val && typeof val === "object" && !!val.base64Data, + { + message: "Please upload document", + } + ), }); export const DeliveryChallanDefaultValue = {