diff --git a/src/Components/Resource/BadgesList.tsx b/src/Components/Resource/BadgesList.tsx index 8cb1fa6199b..1b5a28a8209 100644 --- a/src/Components/Resource/BadgesList.tsx +++ b/src/Components/Resource/BadgesList.tsx @@ -11,13 +11,9 @@ function useFacilityQuery(facilityId: string | undefined) { export default function BadgesList(props: any) { const { appliedFilters, FilterBadges } = props; - const originFacilityData = useFacilityQuery(appliedFilters.origin_facility); - const approvingFacilityData = useFacilityQuery( - appliedFilters.approving_facility - ); - const assignedFacilityData = useFacilityQuery( - appliedFilters.assigned_facility - ); + const originFacility = useFacilityQuery(appliedFilters.origin_facility); + const approvingFacility = useFacilityQuery(appliedFilters.approving_facility); + const assignedFacility = useFacilityQuery(appliedFilters.assigned_facility); const getDescShiftingFilterOrder = (ordering: any) => { const foundItem = SHIFTING_FILTER_ORDER.find( @@ -41,20 +37,16 @@ export default function BadgesList(props: any) { }), ...dateRange("Modified", "modified_date"), ...dateRange("Created", "created_date"), - value( - "Origin facility", - "origin_facility", - originFacilityData?.data?.name - ), + value("Origin facility", "origin_facility", originFacility?.data?.name), value( "Approving facility", "approving_facility", - approvingFacilityData?.data?.name + approvingFacility?.data?.name ), value( "Assigned facility", "assigned_facility", - assignedFacilityData?.data?.name + assignedFacility?.data?.name ), ]} /> diff --git a/src/Components/Resource/ResourceDetailsUpdate.tsx b/src/Components/Resource/ResourceDetailsUpdate.tsx index f21ea4f0f84..c692618a774 100644 --- a/src/Components/Resource/ResourceDetailsUpdate.tsx +++ b/src/Components/Resource/ResourceDetailsUpdate.tsx @@ -127,7 +127,7 @@ export const ResourceDetailsUpdate = (props: resourceProps) => { dispatch({ type: "set_form", form }); }; - const { data: resourceDetailsData } = useQuery(routes.getResourceDetails, { + const { data: resourceDetails } = useQuery(routes.getResourceDetails, { pathParams: { id: props.id }, onResponse: ({ res, data }) => { if (res && data) { @@ -159,7 +159,7 @@ export const ResourceDetailsUpdate = (props: resourceProps) => { assigned_quantity: state.form.status === "PENDING" ? state.form.assigned_quantity - : resourceDetailsData?.assigned_quantity || 0, + : resourceDetails?.assigned_quantity || 0, }; const { res, data } = await request(routes.updateResource, { @@ -189,7 +189,7 @@ export const ResourceDetailsUpdate = (props: resourceProps) => {
diff --git a/src/Redux/api.tsx b/src/Redux/api.tsx index 0761f9a2be1..01c356f6603 100644 --- a/src/Redux/api.tsx +++ b/src/Redux/api.tsx @@ -28,6 +28,7 @@ import { AssetUpdate, } from "../Components/Assets/AssetTypes"; import { + ConsultationModel, FacilityModel, LocationModel, WardModel, @@ -42,9 +43,11 @@ import { } from "../Components/ExternalResult/models"; import { Prescription } from "../Components/Medicine/models"; - + import { UserModel } from "../Components/Users/models"; import { PaginatedResponse } from "../Utils/request/types"; +import { PatientModel } from "../Components/Patient/models"; +import { IComment, IResource } from "../Components/Resource/models"; /** * A fake function that returns an empty object casted to type T