Open Bnaya opened 5 years ago
Let us review this. We already had a similar issue when we had to filter on a related record. But we ended up in adding "id" field to entity class along with the related record field (like category and categoryId in product class).
Thanks! Aside of that immediate proposed change, I'm exploring additional paths to have a ability to configure the requests on the dataProvider side, As it seems react-admin seems won't change it on their end https://github.com/marmelab/react-admin/issues/3411#issuecomment-513205106
Any chance to chat directly somehow? :)
My email: me@bnaya.net
Replied over email
Hi! Is there any update on this issue as well as the PR? Thanks in advance for such a great project :)
hey @humbertowoody you can use https://www.npmjs.com/package/bnaya_fork_ra-data-nest-crud for the meanwhile
Thanks @Bnaya :) Will do!
In nestjsx/crud, by default, all relations are none-eager. To make them load, we need to add
&join=...
to the URL. (Or turn on eager true on the controller.) But what if, sometimes, we don't want them to be on? Or we want only some of them?React admin and the current dataProvider api does not have a way to configure extra query params, but only
filter
&sort
But i have an idea for a possible solution: pack the wish params inside the resource name, in a way the dataProvider will understand.
Possible implementation: https://github.com/FusionWorks/react-admin-nestjsx-crud-dataprovider/pull/8/files#diff-1fdf421c05c1140f6d71444ea2b27638R218
Related: https://github.com/marmelab/react-admin/issues/3411 https://github.com/nestjsx/crud/issues/160
Additional points: customisable filter (One input -> several fields, event nested, with several different operators)