You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When dealing with file upload sometimes it is necessary to override content-type (enctype) and http verb (method) to provide a full support. For example, in PHP you can not use PUT to send a file (https://www.php.net/manual/en/features.file-upload.put-method.php), so you will need to override to POST verb even on a REST update operation.
Describe the solution you'd like
The solution is already specified on HTML specification. To use enctype (or formenctype on button) and method (or formmethod on button) on the form tags.
Today, even if you force that the HTML form generated by react components on react-admin follow those specifications (it would be good to have a props on the form element and create and edit buttons to be able to provide those options, but for this issue, lets assume we got a form with those defaults HTML attributes), the current dataProvider interface will discard those informations and get only the parsed data from the input and the resource name.
Describe alternatives you've considered
Currently, I'm following a workaround using a verification based on the resource name and forcing a change on those attributes overwriting the default dataProvider httpClient parameters on those case. I know I can also use transform to send some trigger data). But it looks a little dirty to depend on a name validation or even on a data transform to provide it as it is standard HTML specifications and should be more standard interface way to do it.
It would be better if there is a defined way on the dataProvider interface to receive html form attributes and deliver for dataProvider (maybe add it on params key?)
The text was updated successfully, but these errors were encountered:
React-admin doesn't speak HTTP. It speaks dataProvider. If you want to pass information from the UI to the dataProvider, you'll have to do it via hidden inputs, localStorage, or any other means, and do the translation to HTTP in your dataProvider.
Is your feature request related to a problem? Please describe.
When dealing with file upload sometimes it is necessary to override content-type (enctype) and http verb (method) to provide a full support. For example, in PHP you can not use PUT to send a file (https://www.php.net/manual/en/features.file-upload.put-method.php), so you will need to override to POST verb even on a REST update operation.
Describe the solution you'd like
The solution is already specified on HTML specification. To use enctype (or formenctype on button) and method (or formmethod on button) on the form tags.
Today, even if you force that the HTML form generated by react components on react-admin follow those specifications (it would be good to have a props on the form element and create and edit buttons to be able to provide those options, but for this issue, lets assume we got a form with those defaults HTML attributes), the current dataProvider interface will discard those informations and get only the parsed data from the input and the resource name.
Describe alternatives you've considered
Currently, I'm following a workaround using a verification based on the resource name and forcing a change on those attributes overwriting the default dataProvider httpClient parameters on those case. I know I can also use transform to send some trigger data). But it looks a little dirty to depend on a name validation or even on a data transform to provide it as it is standard HTML specifications and should be more standard interface way to do it.
It would be better if there is a defined way on the dataProvider interface to receive html form attributes and deliver for dataProvider (maybe add it on params key?)
The text was updated successfully, but these errors were encountered: