fixed attachment issue. using added documentId

This commit is contained in:
pramod.mahajan 2025-12-01 10:26:54 +05:30
parent 0482bfe191
commit 194b032870
3 changed files with 11 additions and 8 deletions

View File

@ -72,7 +72,7 @@ const ManagePurchase = ({ onClose, purchaseId }) => {
fileName: doc.fileName, fileName: doc.fileName,
base64Data: null, base64Data: null,
contentType: doc.contentType, contentType: doc.contentType,
documentId: doc.documentId, documentId: doc.documentId ?? null,
invoiceAttachmentTypeId: doc.invoiceAttachmentType?.id ?? null, invoiceAttachmentTypeId: doc.invoiceAttachmentType?.id ?? null,
fileSize: 0, fileSize: 0,
description: "", description: "",
@ -155,7 +155,7 @@ const ManagePurchase = ({ onClose, purchaseId }) => {
> >
<button <button
type="button" type="button"
className="step-trigger" className={`step-trigger`}
onClick={() => purchaseId && setActiveTab(index)} onClick={() => purchaseId && setActiveTab(index)}
> >
<span className="bs-stepper-circle"> <span className="bs-stepper-circle">
@ -185,9 +185,12 @@ const ManagePurchase = ({ onClose, purchaseId }) => {
<div className="bs-stepper-content py-2 px-3"> <div className="bs-stepper-content py-2 px-3">
<AppFormProvider {...purchaseOrder}> <AppFormProvider {...purchaseOrder}>
<form <form
onKeyDown={(e) => onSubmitCapture={(e) => {
e.key === "Enter" && activeTab !== 2 && e.preventDefault() if (activeTab !== 2) {
} e.preventDefault();
e.stopPropagation();
}
}}
onSubmit={purchaseOrder.handleSubmit(onSubmit)} onSubmit={purchaseOrder.handleSubmit(onSubmit)}
> >
{stepsConfig[activeTab].component} {stepsConfig[activeTab].component}
@ -215,7 +218,7 @@ const ManagePurchase = ({ onClose, purchaseId }) => {
</button> </button>
) : ( ) : (
<button <button
type="submit" type={activeTab == 2 ? "submit" : "button"}
className="btn btn-sm btn-primary" className="btn btn-sm btn-primary"
disabled={isPending || isUpdating} disabled={isPending || isUpdating}
> >

View File

@ -58,8 +58,7 @@ const PurchaseList = ({ searchString }) => {
<tr> <tr>
<td <td
colSpan={visibleColumns.length} colSpan={visibleColumns.length}
className="text-center py-4" className="text-center py-4 border-0"
colSpan={4}
> >
No Data Found No Data Found
</td> </td>

View File

@ -23,6 +23,7 @@ export const AttachmentSchema = z.object({
}), }),
description: z.string().optional().default(""), description: z.string().optional().default(""),
isActive: z.boolean().default(true), isActive: z.boolean().default(true),
documentId:z.string().nullable().default(null)
}); });