What you were expecting:
The dataProvider CREATE type data request to return created data from the server.
What happened instead:
It returns the params you pass to it instead. If your backend adds data to the record, you are unable to access that data unless you fetch the record again.
I'm not sure if this is intended.
Related code:
https://github.com/marmelab/react-admin/blob/master/packages/ra-data-json-server/src/index.js#L123
https://github.com/marmelab/react-admin/blob/master/packages/ra-data-simple-rest/src/index.js#L127
This is somewhat intentional - it allows to make as few assumptions as possible about the server response format.
I understand your request, but I'm afraid it would be a BC break for the simple and json-server data providers. So I'm relunctant to change their behavior - especially knowing how common and easy it is to create your own dataProvider.
Any thoughts?
In that case I would make it clear in the docs. Yesterday I had a rough day identifying where the problem was coming from. Especially considering the other data requests behave differently in that regard.
Thank you for the clarification
At least in aor-feathers-client we add this change on version 2.x (react-admin support).
https://github.com/josx/aor-feathers-client/commit/1e681448ce32eccb27ae3e219b0a57059bd49fee
Marking this as an enhancement to make on the documentation of the simple and json-server data providers
Fixed by #2262
Most helpful comment
This is somewhat intentional - it allows to make as few assumptions as possible about the server response format.
I understand your request, but I'm afraid it would be a BC break for the
simpleandjson-serverdata providers. So I'm relunctant to change their behavior - especially knowing how common and easy it is to create your owndataProvider.Any thoughts?