Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
PFM-5971 Added a default function to select a default jurisdiction ( #…
Browse files Browse the repository at this point in the history
…766  )

PFM-5971 Added a default function to select a default jurisdiction fo…
  • Loading branch information
anilsingha-eGov authored Apr 10, 2024
2 parents e3e14da + b50389f commit 3d43c79
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const Jurisdictions = ({ t, config, onSelect, userType, formData }) => {
}, []);

useEffect(() => {
let cities = [Digit.ULBService.getCurrentTenantId()]
let cities = userData?.user[0]?.roles?.map((role) => role.tenantId)?.filter((value, index, array) => array.indexOf(value) === index);

selectboundary(
data?.MdmsRes?.tenant?.tenants
Expand Down Expand Up @@ -339,6 +339,16 @@ function Jurisdiction({
const STATE_ADMIN = Digit.UserService.hasAccess(["STATE_ADMIN"]);
let isMobile = window.Digit.Utils.browser.isMobile();
const isEdit = window.location.href?.includes("hrms/edit");
let defaultjurisdiction = () =>{
let currentTenant = Digit.ULBService.getCurrentTenantId();
let defaultjurisdiction;
Boundary?.map((ele)=>{
if (ele.code === currentTenant){
defaultjurisdiction = ele;
}
})
return defaultjurisdiction;
}

// useEffect(() => {
// selectBoundaryType(
Expand Down Expand Up @@ -595,7 +605,7 @@ function Jurisdiction({
<Dropdown
className="form-field"
isMandatory={true}
selected={jurisdiction?.boundary}
selected={jurisdiction?.boundary || defaultjurisdiction()}
option={Boundary}
select={selectedboundary}
optionKey="i18text"
Expand Down

0 comments on commit 3d43c79

Please sign in to comment.