diff --git a/src/components/PayerSearcher.js b/src/components/PayerSearcher.js index 87d1a7a..7fef89c 100644 --- a/src/components/PayerSearcher.js +++ b/src/components/PayerSearcher.js @@ -46,14 +46,14 @@ const PayerSearcher = (props) => { }, []); const getHeaders = useCallback( - () => [ + (filters) => [ "payer.name", "payer.type", "payer.address", "payer.region", "payer.district", - "payer.validityFrom", - "payer.validityTo", + filters?.showHistory?.value ? "payer.validityFrom" : null, + filters?.showHistory?.value ? "payer.validityTo" : null, "", ], [], @@ -79,25 +79,24 @@ const PayerSearcher = (props) => { (p) => p.address, (p) => formatLocation(p.location?.parent ?? p.location), (p) => formatLocation(p.location?.parent ? p.location : null), - (p) => formatDateFromISO(p.validityFrom), - (p) => formatDateFromISO(p.validityTo), - (p) => - !filters.showHistory?.value ? ( -