-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
validateResponseFormat triggers error when calling a dataProvider custom method #8083
Comments
Thanks for your pertinent report. IMHO, Feedback on this topic will be very gladly welcomed! |
I agree, https://marmelab.com/react-admin/DataProviderWriting.html#request-format I'm marking this as an enhancement. Feel free to open a PR to implement it. |
I can try to help with this update |
Sure, please do! |
Fixed by #8159 |
If you implement a data provider with a custom method, then call that method as documented here then
validateResponseFormat()
throws an error if the returned object doesn't contain a 'data' keyThe response to 'action' must be like { data: ... }, but the received response does not have a 'data' key. The dataProvider is probably wrong for 'action'.
I think if it's a custom method, there should not be any validation of the returned object (how could react-admin know?)
Otherwise, maybe the type of
DataProvider
should be typed better than[key: string]: any
The text was updated successfully, but these errors were encountered: