diff --git a/apps/storefront/src/pages/registered/Registered.tsx b/apps/storefront/src/pages/registered/Registered.tsx index 1c46c2ca..ee101767 100644 --- a/apps/storefront/src/pages/registered/Registered.tsx +++ b/apps/storefront/src/pages/registered/Registered.tsx @@ -76,10 +76,11 @@ export default function Registered() { const customAddress = billingAddress.length && billingAddress.filter((field: RegisterFileds) => field.custom) const addressExtraFields: Array = conversionDataFormat(customAddress) - addressInformationFields(b3Lang).forEach((addressFileds) => { + const newAddressInformationFields = addressInformationFields(b3Lang).map((addressFileds) => { if (addressFileds.name === 'country') { addressFileds.options = countries } + return addressFileds }) const filterPasswordInformation = customerAccount.length && customerAccount.filter((field: RegisterFileds) => !field.custom && field.fieldType === 'password') @@ -97,7 +98,7 @@ export default function Registered() { companyExtraFields: [...newCompanyExtraFields], companyInformation: [...companyInformationFields(b3Lang)], companyAttachment: [...companyAttachmentsFields(b3Lang)], - addressBasicFields: [...addressInformationFields(b3Lang)], + addressBasicFields: [...newAddressInformationFields], addressExtraFields: [...addressExtraFields], countryList: [...countries], passwordInformation: [...newPasswordInformation], diff --git a/apps/storefront/src/pages/registered/RegisteredDetail.tsx b/apps/storefront/src/pages/registered/RegisteredDetail.tsx index 4e64aee9..7a6a0cf0 100644 --- a/apps/storefront/src/pages/registered/RegisteredDetail.tsx +++ b/apps/storefront/src/pages/registered/RegisteredDetail.tsx @@ -21,7 +21,6 @@ import { RegisteredContext } from './context/RegisteredContext' import { CustomFieldItems, RegisterFileds, - addressInformationFields, Country, State, Base64, @@ -73,7 +72,7 @@ export default function RegisteredDetail(props: any) { const handleCountryChange = (countryCode: string, stateCode: string = '') => { const stateList = countryList.find((country: Country) => country.countryCode === countryCode)?.states || [] - const stateFields = addressInformationFields(b3Lang).find((formFileds: RegisterFileds) => formFileds.name === 'state') + const stateFields = addressBasicFields.find((formFileds: RegisterFileds) => formFileds.name === 'state') if (stateFields) { if (stateList.length > 0) { @@ -91,7 +90,7 @@ export default function RegisteredDetail(props: any) { type: 'stateList', payload: { stateList, - addressBasicFields: [...addressInformationFields(b3Lang)], + addressBasicFields: [...addressBasicFields], }, }) } diff --git a/apps/storefront/src/pages/registered/context/RegisteredContext.tsx b/apps/storefront/src/pages/registered/context/RegisteredContext.tsx index 36ebc1fb..77e1ecff 100644 --- a/apps/storefront/src/pages/registered/context/RegisteredContext.tsx +++ b/apps/storefront/src/pages/registered/context/RegisteredContext.tsx @@ -13,7 +13,7 @@ interface RegisterState { companyInformation?: Array | Array<[]>, companyExtraFields?: Array | Array<[]>, companyAttachment?: Array | Array<[]>, - addressBasicFields?: Array | Array<[]>, + addressBasicFields?: Array, addressExtraFields?: Array | Array<[]>, countryList?: Array, stateList?: Array,