Support for resource nesting

后端 未结 3 1147
无人共我
无人共我 2020-12-07 02:57

I am wondering, is it possible to configure DataProvider/Resource/List to support REST urls like api/users/1/roles?

For RESTful API it is very common us

3条回答
  •  醉酒成梦
    2020-12-07 03:36

    TL;DR: By default, React Admin doesn't support nested resource, you have to write a custom data provider.

    This question was answered on a past issue: maremelab/react-admin#261

    Detailed Answer

    The default data provider in React Admin is ra-data-simple-rest.

    As explained on its documentation, this library doesn't support nested resources since it only use the resource name and the resource ID to build a resource URL:

    In order to support nested resources, you have to write your own data provider.

    Nested resources support is a recurrent feature request but, at the time, the core team don't want to handle this load of work.

    I strongly suggest to gather your forces and write an external data provider and publish it like ra-data-odata provider. It would be a great addition and we will honored to help you with that external package.

提交回复
热议问题