Skip to content

Commit

Permalink
Merge pull request upyog#996 from sriranjan-s/Dev-2.0
Browse files Browse the repository at this point in the history
Added owner details fix
  • Loading branch information
sriranjan-s authored Mar 13, 2024
2 parents 94eaca7 + 8899de2 commit cf67163
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -424,14 +424,13 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => {
setIsDisable(false);
setShowToast({ key: "true", error: true, message: e?.response?.data?.Errors[0]?.message });
});
}
}
} else {
onSelect(config.key, ownerStep);
}
}
}
};

const onSkip = () => onSelect();

// if (isLoading) {
Expand All @@ -450,57 +449,14 @@ const OwnerDetails = ({ t, config, onSelect, userType, formData }) => {
else
return true;
}
let propertyData =JSON.parse(sessionStorage.getItem("Digit_OBPS_PT"))
if(propertyData?.owners.length >0)
{
fields = propertyData.owners.map((owner) => {
let gender
if (owner.gender == "FEMALE") {
gender = {
"code": "FEMALE",
"active": true,
"i18nKey": "COMMON_GENDER_FEMALE"
}
return { "name": owner.name, "emailId": owner.emailId, "mobileNumber": owner.mobileNumber, gender: gender, isPrimaryOwner }
}
else if (owner.gender == "MALE") {
gender = {
"code": "MALE",
"active": true,
"i18nKey": "COMMON_GENDER_MALE"
}
return { "name": owner.name, "emailId": owner.emailId, "mobileNumber": owner.mobileNumber, gender: gender, isPrimaryOwner }
}

})
}

useEffect(()=>{
let propertyData =JSON.parse(sessionStorage.getItem("Digit_OBPS_PT"))
if(propertyData?.owners?.length == 1)
{let value ={
"code": "INDIVIDUAL.SINGLEOWNER",
"active": true,
"i18nKey": "COMMON_MASTERS_OWNERSHIPCATEGORY_INDIVIDUAL_SINGLEOWNER"
}
selectedValue(value);
}
else if(propertyData?.owners?.length > 1)
{
let value={
"code": "INDIVIDUAL.MULTIPLEOWNERS",
"active": true,
"i18nKey": "COMMON_MASTERS_OWNERSHIPCATEGORY_INDIVIDUAL_MULTIPLEOWNERS"
}
selectedValue(value);
}
},[])



return (
<div>
<Timeline currentStep={2} />
<FormStep config={config} onSelect={goNext} onSkip={onSkip} t={t} isDisabled={canmovenext || getCanMoveNextMultiple() || !ownershipCategory || isDisable || showToast} forcedError={t(error)}>
<FormStep config={config} onSelect={goNext} onSkip={onSkip} t={t} isDisabled={canmovenext || getCanMoveNextMultiple() || !ownershipCategory || isDisable} forcedError={t(error)}>
{!isLoading ?
<div style={{marginBottom: "10px"}}>
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const newConfig1=[
{
"route": "scrutiny-details",
"component": "ScrutinyDetails",
"nextStep": "search-property",
"nextStep": "location",
"hideInEmployee": true,
"key": "subOccupancy",
"texts": {
Expand Down

0 comments on commit cf67163

Please sign in to comment.