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

View File

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

View File

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