I have a REST API that lets you access associated resources like this:
GET /samples
lists all samplesGET /samples/1
describes sample 1 in detailGET /samples/1/data
lists all data belonging to sample 1
I'm trying to hook this up with react-admin
, where I have the following <Admin>
component:
<Admin dataProvider={dataProvider}>
<Resource name="samples" list={SampleList} show={SampleShow} edit={SampleEdit}/>
</Admin>
So, I now want to add a list component for data
, but I do not want the user to be able to list all data. I just want the user to be able to see all data associated with a sample: a page representing the GET /samples/1/data
URL.
As a consequence, I don't want data
appearing as a resource on the sidebar/front page. I just want to have a SampleList
and SampleShow
components to be able to link to a list of associated data. How can I do this with react-admin
?