Skip to content

Commit

Permalink
Merge pull request #368 from AkshataKatwal16/relese-changes
Browse files Browse the repository at this point in the history
Issue feat:Master data update
  • Loading branch information
itsvick authored Nov 30, 2024
2 parents bfad3ae + 016e3dd commit 129a60f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/pages/block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ const setIsArchived = useSubmittedButtonStore(
const districts = data?.result?.values || [];
setDistrictsOptionRead(districts);

const districtNameArray = districts.map((item: any) => item.label);
const districtNameArray = districts.map((item: any) => item.label?.toLowerCase());
setDistrictNameArr(districtNameArray);

const districtCodeArray = districts.map((item: any) => item.value);
Expand Down Expand Up @@ -262,7 +262,7 @@ const setIsArchived = useSubmittedButtonStore(
}
)
.filter((district: { label: any }) =>
districtNameArr.includes(district.label)
districtNameArr.includes(district.label?.toLowerCase())
);
if (isFirstVisit) {
if (
Expand Down Expand Up @@ -321,7 +321,7 @@ const setIsArchived = useSubmittedButtonStore(
const blocks = response?.result?.values || [];
setBlocksOptionRead(blocks);

const blockNameArray = blocks.map((item: any) => item.label.toLowerCase());
const blockNameArray = blocks.map((item: any) => item.label?.toLowerCase());
setBlockNameArr(blockNameArray);

const blockCodeArray = blocks.map((item: any) => item.value);
Expand Down Expand Up @@ -412,7 +412,7 @@ const setIsArchived = useSubmittedButtonStore(
};
}
)
.filter((block: { name: string }) => blockNameArr.includes(block.name));
.filter((block: { name: string }) => blockNameArr.includes(block.name?.toLocaleLowerCase()));

setBlockData(filteredBlockData);
setShowAllBlocks(filteredBlockData);
Expand Down
6 changes: 3 additions & 3 deletions src/pages/district.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const District: React.FC = () => {
const districts = data?.result?.values || [];
setDistrictsOptionRead(districts);

const districtNameArray = districts.map((item: any) => item.label.toLowerCase());
const districtNameArray = districts.map((item: any) => item.label?.toLowerCase());
setDistrictNameArr(districtNameArray);

const districtCodeArray = districts.map((item: any) => item.value);
Expand Down Expand Up @@ -252,7 +252,7 @@ const District: React.FC = () => {

const matchingDistrict = districtsOptionRead.find(
(district: { label: string }) =>
district.label.toLowerCase() === transformedName.toLowerCase()
district.label?.toLowerCase() === transformedName?.toLowerCase()
);

return {
Expand All @@ -267,7 +267,7 @@ const District: React.FC = () => {
}
)
.filter((district: { label: any }) =>
districtNameArr.includes(district.label)
districtNameArr.includes(district?.label?.toLowerCase())
);

setDistrictData(filteredDistrictData);
Expand Down

0 comments on commit 129a60f

Please sign in to comment.