Skip to content

Commit

Permalink
OM-278: added filtering by economic unit if there is economic unit co…
Browse files Browse the repository at this point in the history
…nfig
  • Loading branch information
sniedzielski committed Aug 30, 2024
1 parent 3ace8fa commit 950c97c
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 = {
};

if (economicUnitConfig && economicUnit?.id && !isAdminOrInspector) {
additionalExportFields.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 950c97c

Please sign in to comment.