From 6e2fc511993a55baf452d41d10b5cf8f829ed77f Mon Sep 17 00:00:00 2001 From: sniedzielski <52816247+sniedzielski@users.noreply.github.com> Date: Wed, 27 Sep 2023 10:47:11 +0200 Subject: [PATCH] CM-323: fixed displaying params on contract level (#61) --- src/components/ContractForm.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/ContractForm.js b/src/components/ContractForm.js index 560a6fb..c38da14 100644 --- a/src/components/ContractForm.js +++ b/src/components/ContractForm.js @@ -94,7 +94,12 @@ class ContractForm extends Component { this.setState((state, props) => ({ contract: { ...state.contract, - policyHolder: props.policyHolders.find((v) => decodeId(v.id) === props.predefinedPolicyHolderId) + policyHolder: props.predefinedPolicyHolderId + ? props.policyHolders.find((v) => decodeId(v.id) === props.predefinedPolicyHolderId) + : ( props.contract.policyHolder + ? props.policyHolders.find((v) => decodeId(v.id) === decodeId(props.contract.policyHolder.id)) + : null + ) } })); }