Skip to content

Commit

Permalink
[MDS-5598] Fixing edit documents issue (#2790)
Browse files Browse the repository at this point in the history
* fixing edit documents issue

* reverting changes to MineExplosivesPermitTable.tsx

* fix the be call to call esuppermit when no amendment instead of esuppermitamendment endpoint

* fixing typo
  • Loading branch information
isuru-aot authored Nov 14, 2023
1 parent 32f160f commit 97390b6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,14 @@ export const ExplosivesPermit: FC<ExplosivesPermitProps> = ({

const handleOpenAddExplosivesPermitModal = (event, permitTab, record = null) => {
const initialValues = record || {};
const hasAmendments = record?.explosives_permit_amendments?.length > 1;
const isProcessed = record !== null && record?.application_status !== "REC";
event.preventDefault();
props.openModal({
props: {
onSubmit: record ? handleUpdateExplosivesPermit : handleAddExplosivesPermit,
onSubmit: (values) => {
record ? handleUpdateExplosivesPermit(values, hasAmendments) : handleAddExplosivesPermit(values)
},
title: "Add Permit",
initialValues,
documents: record?.documents ?? [],
Expand Down

0 comments on commit 97390b6

Please sign in to comment.