Skip to content

Commit

Permalink
update pr
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshataKatwal16 committed Nov 29, 2024
1 parent 788ceff commit 016e3dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 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.toLowerCase());
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.toLowerCase())
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.toLocaleLowerCase()));
.filter((block: { name: string }) => blockNameArr.includes(block.name?.toLocaleLowerCase()));

setBlockData(filteredBlockData);
setShowAllBlocks(filteredBlockData);
Expand Down
4 changes: 2 additions & 2 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 Down

0 comments on commit 016e3dd

Please sign in to comment.