I have React Admin routing issue and now sure how to fix it.
<Resource
name="licenses"
icon={SchoolIcon}
options={{ label: "Licenses" }}
list={License}
>
<Route path=":licenseId/calls" element={<Call />} />
<Route path=":licenseId/calls/:id" element={<CallShow />} />
</Resource>
I have this license resource with list page created by react-admin. A data grid is created with a list of licenses.
I’m adding two new Routes to it which looks:
- /:licenseId/calls – on licenses data grid row click – redirects and show list of calls by licenseId
- /:licenseId/calls/:id – on calls by license id data grid row click – redirects and show details about selected call
This way I did the redirects from :licenseId/calls to :licenseId/calls/:id
<Datagrid
rowClick={(id: any) => `/licenses/${licenseId}/calls/${id}` }
>
My issue is that once I click on the row from /:licenseId/calls (list of calls by licenseId list) there is an automatic api call to /licenses/:id but I’m expecting /licenses/:licenseId/calls/:id or no call to api