Hi, I am not sure whether I should report this under bug or make it a proposed feature...
What you were expecting:
When doing a create operation on database, I expected that the source props of components determine the json attribute. For example,
<FormTab label="resources.choices.tabs.details" path="details">
<NumberInput
source="priceRange"
/>
</FormTab>
I was expecting a json like this {priceRange: ...} to pass to backend when saving the form.
What happened instead:
the above produces a json like this {price_range: ...} when passed to the backend.
Thank you.
This is most probably done by your dataProvider. The react-admin components do not transform the source.
This is most probably done by your dataProvider. The react-admin components do not transform the source.
I see, I thought I was specifying the attributes of the json I'm going to submit to the backend through the source, and react-admin transforms it from camelCase to snake_case, which is not what I wanted.
You are specifying them but it looks like your dataProvider is changing them. Please provide a codesandbox showing the issue or ask the question on Stackoverflow.
You are specifying them but it looks like your dataProvider is changing them. Please provide a codesandbox showing the issue or ask the question on Stackoverflow.
Yup, it's the data provider... thanks!
Most helpful comment
Yup, it's the data provider... thanks!