4

How I can show error response message from my API server react-admin version 3.0 ?

This variant doesn't work https://github.com/marmelab/react-admin/pull/871

enter image description here

  • Hi Pavel, and welcome to stack overflow. Could you please create a minimal example of your problem? Show us the code you've tried and what errors you are getting, not as pictures behind links but as formatted text right in your question. As much as everyone wants to help out, nobody likes clicking on weird links. Also, by including everything right in your question, there is no risk of stale links in the future. Thanks! – borizzzzz Jan 24 '20 at 13:59

2 Answers2

0

I just return something like this from the backend:

{
    'message':'Form validation error', //This is the message.
    'HTTPCode':500
}

I'm pretty sure that I've read something about this on the docs, but I'm unable to find it.... Sorry....

It should really be more documented.

0

The documentation suggests you try structuring your error messages as follows:

{
  myName: "This field is required",
  myPhone: "Please use only digits"
}
WiXSL
  • 689
  • 5
  • 16