Unverified Commit 732a6aa1 authored by Zhou (Link)  Fang's avatar Zhou (Link) Fang Committed by GitHub
Browse files

Fixed duplicated contacts issue (#261)

* Fixed contact id issue

* Fixed contact id changes accidentally

* Fixed Signing Authority id undefined issue
parent 78231aab
...@@ -529,21 +529,21 @@ function callSendData( ...@@ -529,21 +529,21 @@ function callSendData(
case 'representative.member': case 'representative.member':
setFieldValueObj.method( setFieldValueObj.method(
`${setFieldValueObj.fieldName}.id`, `${setFieldValueObj.fieldName}.id`,
data?.id data[0]?.id
); );
break; break;
case 'representative.marketing': case 'representative.marketing':
setFieldValueObj.method( setFieldValueObj.method(
`${setFieldValueObj.fieldName}.id`, `${setFieldValueObj.fieldName}.id`,
data?.id data[0]?.id
); );
break; break;
case 'representative.accounting': case 'representative.accounting':
setFieldValueObj.method( setFieldValueObj.method(
`${setFieldValueObj.fieldName}.id`, `${setFieldValueObj.fieldName}.id`,
data?.id data[0]?.id
); );
break; break;
...@@ -561,11 +561,11 @@ function callSendData( ...@@ -561,11 +561,11 @@ function callSendData(
case 'signingAuthorityRepresentative': case 'signingAuthorityRepresentative':
setFieldValueObj.method.signingAuthority( setFieldValueObj.method.signingAuthority(
`${setFieldValueObj.fieldName}.id`, `${setFieldValueObj.fieldName}.id`,
data?.id data[0]?.id
); );
setFieldValueObj.method.companyInfo( setFieldValueObj.method.companyInfo(
`${setFieldValueObj.fieldName}.id`, `${setFieldValueObj.fieldName}.id`,
data?.id data[0]?.id
); );
break; break;
......
...@@ -44,6 +44,7 @@ const Contacts = ({ formik }) => { ...@@ -44,6 +44,7 @@ const Contacts = ({ formik }) => {
const newValues = { const newValues = {
...repInfo, ...repInfo,
sameAsCompany: isChecked, sameAsCompany: isChecked,
id: formik.values.representative[fieldName].id
}; };
formik.setFieldValue(`representative.${fieldName}`, newValues); formik.setFieldValue(`representative.${fieldName}`, newValues);
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment