Skip to content

Commit

Permalink
fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
konavivekramakrishna committed Oct 26, 2023
1 parent cbd67b4 commit 136f375
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
20 changes: 6 additions & 14 deletions src/Components/Resource/BadgesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
),
]}
/>
Expand Down
6 changes: 3 additions & 3 deletions src/Components/Resource/ResourceDetailsUpdate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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, {
Expand Down Expand Up @@ -189,7 +189,7 @@ export const ResourceDetailsUpdate = (props: resourceProps) => {
<Page
title="Update Resource Request"
backUrl={`/resource/${props.id}`}
crumbsReplacements={{ [props.id]: { name: resourceDetailsData?.title } }}
crumbsReplacements={{ [props.id]: { name: resourceDetails?.title } }}
>
<div className="mt-4">
<Card className="flex w-full flex-col">
Expand Down
5 changes: 4 additions & 1 deletion src/Redux/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
AssetUpdate,
} from "../Components/Assets/AssetTypes";
import {
ConsultationModel,
FacilityModel,
LocationModel,
WardModel,
Expand All @@ -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
Expand Down

0 comments on commit 136f375

Please sign in to comment.