Use server-side validation response in react-admin

北城余情 提交于 2020-02-28 07:13:06

问题


In my app using react-admin I have a few forms where the validation must be performed on the server side. My API (implemented with api-platform) returns a 400 response with a key in its body that contains an array of the constraint violations, keyed to the field names, so the information is there to provide field-by-field error messages.

This issue is the same explored in this old question. However, since react-admin moved from redux-form to react-final-form, solutions based on an error saga do not work anymore.

The example given in the official react-final-form docs is not easy to apply because react-admin manages the onSubmit property by itself.

来源:https://stackoverflow.com/questions/60097615/use-server-side-validation-response-in-react-admin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!