From 85b882f1e44ff745d17985309b9480f83fe8513c Mon Sep 17 00:00:00 2001 From: sriharsh05 Date: Fri, 3 Nov 2023 09:46:40 +0530 Subject: [PATCH] change permittedData variable name to permittedFacilities --- src/Components/Patient/ManagePatients.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Components/Patient/ManagePatients.tsx b/src/Components/Patient/ManagePatients.tsx index c0086b39514..24762d10279 100644 --- a/src/Components/Patient/ManagePatients.tsx +++ b/src/Components/Patient/ManagePatients.tsx @@ -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) => { @@ -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"