Skip to content

Commit a17ebf4

Browse files
committed
chore(changeset): @object-ui/react patch for the unique-refusal field mark
Claude-Session: https://claude.ai/code/session_01JQwxbZRo35mpCPrKXVXevY Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1e3573e commit a17ebf4

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@object-ui/react': patch
3+
---
4+
5+
fix(react): a create or edit form marks the field a unique-index refusal names
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Saving a record whose value collides with a unique index (a product SKU, an account name that must be unique) used to show "A record with this value already exists" as a banner and a toast, with no field marked. The user had to guess which of the form's unique fields collided.
11+
12+
The server's `409 UNIQUE_VIOLATION` answer names the one field on `field`, with a sentence that names it by its label ("A record with this SKU already exists"). `extractFieldErrors` only read lists of field errors, so it answered nothing for this refusal. It now returns one entry for it: the named field, carrying the server's sentence. The form renderer writes that sentence under the input, as it does for a `required` field, and shows no banner. Inline edit on a record page reads the same helper, so its save bar attributes the refusal to that field too.
13+
14+
When the server cannot tell which column collided (an index name, a composite key), the answer has no `field` and nothing changes: the banner stays.
15+
16+
What to do: nothing.

0 commit comments

Comments
 (0)