Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
AshrafMd-1 committed Feb 24, 2024
1 parent d774e75 commit 537e0b8
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions src/Components/Common/FacilitySelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ export const FacilitySelect = (props: FacilitySelectProps) => {
district,
};

const { data } = await request(
showAll ? routes.getAllFacilities : routes.getPermittedFacilities,
{ query }
);

if (
homeFacility &&
!showAllFacilityUsers.includes(authUser.user_type) &&
Expand All @@ -69,24 +64,19 @@ export const FacilitySelect = (props: FacilitySelectProps) => {
query["limit"] = 1;
}

const { data } = await request(
showAll ? routes.getAllFacilities : routes.getPermittedFacilities,
{ query }
);

if (freeText)
data?.results?.push({
id: -1,
name: text,
});
return data?.results;
},
[
searchAll,
showAll,
facilityType,
district,
exclude_user,
freeText,
authUser.home_facility_object?.name,
authUser.user_type,
homeFacility,
]
[searchAll, showAll, facilityType, district, exclude_user, freeText]
);

return (
Expand Down

0 comments on commit 537e0b8

Please sign in to comment.