Skip to content

Commit

Permalink
prresolve
Browse files Browse the repository at this point in the history
  • Loading branch information
aaradhya-egov committed Sep 9, 2024
1 parent 4545c04 commit 749c61d
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ const { data: TenantMngmtSearch, isLoading: isLoadingTenantMngmtSearch } = Digit
const [pincode, setPincode] = useState("");
const [selectedCity, setSelectedCity] = useState(
Digit.Utils.getMultiRootTenant()
? getSubTenants()[0] || null
: getCities()[0] || null
? getSubTenants()?.[0] || null
: getCities()?.[0] || null
);

const cityData = Digit.Utils.getMultiRootTenant() ? getSubTenants() : getCities();
Expand All @@ -59,10 +59,10 @@ const { data: TenantMngmtSearch, isLoading: isLoadingTenantMngmtSearch } = Digit
);

const { data: fetchedLocalities } = Digit.Hooks.useBoundaryLocalities(
cityData[0]?.code,
cityData?.[0]?.code,
hierarchyType,
{
enabled: !!cityData[0],
enabled: !!cityData?.[0],
},
t
);
Expand Down Expand Up @@ -95,9 +95,9 @@ const { data: TenantMngmtSearch, isLoading: isLoadingTenantMngmtSearch } = Digit
}, [fetchedLocalities]);

useEffect(() => {
if(window.globalPath !== "sandbox-ui"){
if(Digit.Utils.getMultiRootTenant()){
const city = cities.find((obj) => obj.pincode?.find((item) => item == pincode));
if (city?.code&&city?.code === getCities()[0]?.code) {
if (city?.code&&city?.code === getCities()?.[0]?.code) {
setPincodeNotValid(false);
setSelectedCity(city);
setSelectedLocality(null);
Expand Down

0 comments on commit 749c61d

Please sign in to comment.