Skip to content

Commit

Permalink
change permittedData variable name to permittedFacilities
Browse files Browse the repository at this point in the history
  • Loading branch information
sriharsh05 committed Nov 3, 2023
1 parent 05d165a commit 85b882f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Components/Patient/ManagePatients.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,10 @@ export const PatientManager = () => {
[fetchFacilityBadgeName, fetchLocationBadgeName]
);

const { data: permittedData } = useQuery(routes.getPermittedFacilities, {});
const { data: permittedFacilities } = useQuery(
routes.getPermittedFacilities,
{}
);

const LastAdmittedToTypeBadges = () => {
const badge = (key: string, value: any, id: string) => {
Expand Down Expand Up @@ -787,8 +790,10 @@ export const PatientManager = () => {
onClick={() => {
if (qParams.facility)
navigate(`/facility/${qParams.facility}/patient`);
else if (permittedData?.results.length === 1)
navigate(`/facility/${permittedData?.results[0].id}/patient`);
else if (permittedFacilities?.results.length === 1)
navigate(
`/facility/${permittedFacilities?.results[0].id}/patient`
);
else setShowDialog(true);
}}
className="w-full lg:w-fit"
Expand Down

0 comments on commit 85b882f

Please sign in to comment.