Skip to content

Commit

Permalink
fix (#1364)
Browse files Browse the repository at this point in the history
Co-authored-by: nabeelmd-eGov <[email protected]>
  • Loading branch information
aaradhya-egov and nabeelmd-eGov authored Sep 6, 2024
1 parent 88b1d15 commit d5dba8a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ if (window?.globalPath === 'sandbox-ui') {
includeSubTenants: true
},
body: {
"inbox": {
"limit": 10,
"offset": 0
},
apiOperation: "SEARCH",
},
config: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ if (window.globalPath === 'sandbox-ui') {
includeSubTenants: true
},
body: {
"inbox": {
"limit": 10,
"offset": 0
},
apiOperation: "SEARCH",
},
config: {
Expand All @@ -43,9 +39,26 @@ const { data: subTenants, refetch, isLoading: isLoadingSubTenants } = requestCri
const { city_complaint } = value;
return city_complaint ? city_complaint : null;
});

const { isLoading: hierarchyLOading, data:hierarchyType } = Digit.Hooks.useCustomMDMS(
Digit.ULBService.getStateId(),
"sandbox-ui",
[
{ name: "ModuleMasterConfig",filter:'[?(@.module == "PGR")].master[?(@.type == "boundary")]'

}
],
{
select: (data) => {
const formattedData = data?.["sandbox-ui"]?.["ModuleMasterConfig"]
return formattedData?.[0]?.code;
},
}
);

const { data: fetchedLocalities } = Digit.Hooks.useBoundaryLocalities(
selectedCity?.code,
window.globalPath === "sandbox-ui" ? "REVENUE" : "admin",
hierarchyType,
{
enabled: !!selectedCity,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ if (window.globalPath === 'sandbox-ui') {
includeSubTenants: true
},
body: {
"inbox": {
"limit": 10,
"offset": 0
},
apiOperation: "SEARCH",
},
config: {
Expand Down Expand Up @@ -62,24 +58,31 @@ const { data: subTenants, refetch, isLoading: isLoadingSubTenants } = requestCri

const cityData = window.globalPath === "sandbox-ui" ? getSubTenants() : getCities();

const { isLoading: hierarchyLOading, data:hierarchyType } = Digit.Hooks.useCustomMDMS(
Digit.ULBService.getStateId(),
"sandbox-ui",
[
{ name: "ModuleMasterConfig",filter:'[?(@.module == "PGR")].master[?(@.type == "boundary")]'

}
],
{
select: (data) => {
const formattedData = data?.["sandbox-ui"]?.["ModuleMasterConfig"]
return formattedData?.[0]?.code;
},
}
);

const { data: fetchedLocalities } = Digit.Hooks.useBoundaryLocalities(
cityData[0]?.code,
window.globalPath === "sandbox-ui" ? "REVENUE" : "admin",
hierarchyType,
{
enabled: !!cityData[0],
},
t
);

// const { data: fetchedLocalities } = Digit.Hooks.useBoundaryLocalities(
// getCities()[0]?.code,
// "admin",
// {
// enabled: !!getCities()[0],
// },
// t
// );

const [localities, setLocalities] = useState(fetchedLocalities);
const [selectedLocality, setSelectedLocality] = useState(null);
const [canSubmit, setSubmitValve] = useState(false);
Expand Down

0 comments on commit d5dba8a

Please sign in to comment.