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
What you were expecting: What happened instead:
We have edit form, where one of fields has unique validator - in our case resource should have unique name.
We change one of other resource fields and try to save, but name field is marked as invalid as already existing, although it did not change.
I see, that query returns currently edited record and that's why it fails.
Other information:
I see two ways of solving this (in our case):
do not run validation if field did not change
somehow pass filter like id <> currentRecord.id, but I don't have idea, how to do it as json object
when checking server response, if it contains only one record and id matches current, then pass validation
Environment
React-admin version: 4.12.1
React version: 18.2.0
Browser: chrome
The text was updated successfully, but these errors were encountered:
What you were expecting:
What happened instead:
We have edit form, where one of fields has unique validator - in our case resource should have unique name.
We change one of other resource fields and try to save, but name field is marked as invalid as already existing, although it did not change.
I see, that query returns currently edited record and that's why it fails.
Other information:
I see two ways of solving this (in our case):
id <> currentRecord.id
, but I don't have idea, how to do it as json objectEnvironment
The text was updated successfully, but these errors were encountered: