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
This works fine and gives the expected result, but now let's see what happens if we remove some required fields in the nested object list.
For Example in this case :
"error": "The 'game' field has no data and doesn't allow a default or null value."
And when removing the "score" required field we get something different :
{
"playergames": {
"score": [
"This field is required."
]
}
}
I think this feedback lacks some information to enable any UI to correctly inform the end user were the problem is.
What we should get IMO is something like this :
{
playergame_set: [
{ "score": [ "This field is required." ] },
{ "game": [ "This field is required." ] },
{ "game": [ "This field is required." ], "score": [ "This field is required." ] },
]
}
We need to get a feed back for each row we want to insert and the "key" should be the name of field as we named it in the resource fields. This would enable the front end UI to automatically map error messages to form inputs (displaying each error message exactly under the right input).
I really need some orientations on which parts of the Resource class should I change to get this kind of behavior.
Thank you for taking the time to read this.
The text was updated successfully, but these errors were encountered:
Let's take a minimal example to reproduce this use case :
We want to insert into api/players the following data :
This works fine and gives the expected result, but now let's see what happens if we remove some required fields in the nested object list.
For Example in this case :
We get an error message :
And when removing the "score" required field we get something different :
I think this feedback lacks some information to enable any UI to correctly inform the end user were the problem is.
What we should get IMO is something like this :
We need to get a feed back for each row we want to insert and the "key" should be the name of field as we named it in the resource fields. This would enable the front end UI to automatically map error messages to form inputs (displaying each error message exactly under the right input).
I really need some orientations on which parts of the Resource class should I change to get this kind of behavior.
Thank you for taking the time to read this.
The text was updated successfully, but these errors were encountered: