Skip to content

Commit

Permalink
OP-1342: user health facility is passed to claim admin picker (#88)
Browse files Browse the repository at this point in the history
* OP-1342: user health facility is passed to claim admin picker

* OP-1342: deleted unsued field from state

---------

Co-authored-by: lruzicki <lruzicki@gmail.com>
  • Loading branch information
lruzicki and lruzicki authored Apr 13, 2023
1 parent ae61a02 commit 8fe00ca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
18 changes: 16 additions & 2 deletions src/pickers/ClaimAdminPicker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import React, { useState, useEffect } from "react";
import { useSelector } from "react-redux";

import { useModulesManager, useTranslations, Autocomplete, useGraphqlQuery } from "@openimis/fe-core";
import {
useModulesManager,
useTranslations,
Autocomplete,
useGraphqlQuery,
} from "@openimis/fe-core";


const ClaimAdminPicker = (props) => {
Expand All @@ -21,6 +27,9 @@ const ClaimAdminPicker = (props) => {
region,
district,
} = props;
const userHealthFacilityId = useSelector((state) =>
state?.loc?.userHealthFacilityFullPath?.uuid
);

const modulesManager = useModulesManager();
const { formatMessage } = useTranslations("claim", modulesManager);
Expand Down Expand Up @@ -56,7 +65,12 @@ const ClaimAdminPicker = (props) => {
}
}
`,
{ hf: hfFilter?.uuid, search: searchString, region_uuid: region?.uuid, district_uuid: district?.uuid },
{
hf: userHealthFacilityId || hfFilter?.uuid,
search: searchString,
region_uuid: region?.uuid,
district_uuid: district?.uuid
},
);

return (
Expand Down
1 change: 0 additions & 1 deletion src/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ function reducer(
fetchedClaimCodeCount: false,
claimCodeCount: null,
errorClaimCodeCount: null,
availablehealthFacilities: [],
healthFacilities: {
availableHealthFacilities: [],
isFetching: false,
Expand Down

0 comments on commit 8fe00ca

Please sign in to comment.