I have recently updated my react-admin version from 2.7 to 3.7.1.
Using ExportButton, i used to send an api call to the backend and my export csv used to get served from the backend.
The way i used to do it by manipulating the api call through the ExportButton resource prop. But since i have migrated to the newer version i saw there was no effect of passing anything to resource attribute, the url is getting generated by the default page's url.
I couldn't find anything regarding that new changes has been made to the ExportButton nor any issues stated on the github repo.
thanking you, in advance.
const ListActions = ({
resource,
filterValues,
total,
maxResults,
currentSort,
exporter,
permanentFilter,
showFilter,
displayedFilters,
filters,
}) => {
return (
<TopToolbar style={TopToolbarStyle}>
{filters && cloneElement(filters, {
resource,
showFilter,
displayedFilters,
filterValues,
context: 'button',
})}
<RefreshButton />
<ExportButton
disabled={total === 0}
resource={resource + '_csv'} // used to changs page's url eg: page is home -> home_csv
sort={currentSort}
filter={{ ...filterValues, ...permanentFilter }}
exporter={exporter}
maxResults={maxResults}
/>
</TopToolbar>
)
};