Skip to content

Commit

Permalink
Merge pull request #51 from openimis/feature/OM-278
Browse files Browse the repository at this point in the history
OM-278: added filtering by economic unit if there is economic unit config
  • Loading branch information
olewandowski1 authored Aug 30, 2024
2 parents 3ace8fa + bf20fa7 commit 7111944
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/BillSearcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ const BillSearcher = ({
const economicUnitConfig = modulesManager.getConf("fe-core", "App.economicUnitConfig", DEFAULT.ECONOMIC_UNIT_CONFIG);
const isAdminOrInspector = rights.includes(INSPECTOR_RIGHT) || rights.includes(ADMIN_RIGHT);

const additionalExportFields =
economicUnitConfig &&
economicUnit?.id &&
!isAdminOrInspector
? { subjectId: decodeId(economicUnit?.id) }
: {};

useEffect(() => billToDelete && openConfirmDialog(), [billToDelete]);

useEffect(() => {
Expand Down Expand Up @@ -307,6 +314,7 @@ const BillSearcher = ({
"dateBill": "Date Bill",
"status": "Status",
}}
additionalExportFields={additionalExportFields}
/>
{failedExport && (
<Dialog open={failedExport} fullWidth maxWidth="sm">
Expand Down

0 comments on commit 7111944

Please sign in to comment.