diff --git a/services/core-web/src/components/Forms/reports/AddReporttoPermitConditionForm.tsx b/services/core-web/src/components/Forms/reports/AddReporttoPermitConditionForm.tsx index 284167ebca..830c0f599a 100644 --- a/services/core-web/src/components/Forms/reports/AddReporttoPermitConditionForm.tsx +++ b/services/core-web/src/components/Forms/reports/AddReporttoPermitConditionForm.tsx @@ -28,6 +28,7 @@ interface AddReportToPermitConditionFormProps { permitGuid: string; condition: IPermitCondition; modalView?: boolean; + report?: IMineReport; } export const AddReportToPermitConditionForm: FC = ({ @@ -35,8 +36,8 @@ export const AddReportToPermitConditionForm: FC { - const report = condition?.report; const [isEditMode, setIsEditMode] = React.useState(modalView); return ( @@ -52,7 +53,7 @@ export const AddReportToPermitConditionForm: FC = ({ const addNewReport = async (values) => { await dispatch(createMineReport(mineGuid, values)); + dispatch(fetchPermits(mineGuid)); dispatch(closeModal()); }; @@ -127,6 +129,7 @@ const PermitConditionLayer: FC = ({ }} icon={} type="default" + disabled={!!subCondition.report} > Add Report diff --git a/services/core-web/src/components/mine/Permit/PermitConditions.tsx b/services/core-web/src/components/mine/Permit/PermitConditions.tsx index 5218ef3b44..7cdecd0409 100644 --- a/services/core-web/src/components/mine/Permit/PermitConditions.tsx +++ b/services/core-web/src/components/mine/Permit/PermitConditions.tsx @@ -241,6 +241,7 @@ const PermitConditions: FC = ({ onSubmit={() => {}} condition={cond} permitGuid={permitGuid} + report={cond.report} /> ))}