From aec6930e11cb13dd76628fb765eee6d17b3727ab Mon Sep 17 00:00:00 2001 From: "pramod.mahajan" Date: Fri, 28 Nov 2025 11:35:59 +0530 Subject: [PATCH] fixed challan attachmenet --- src/components/purchase/PurchaseSchema.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 = {