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
When a field of a relationship type is marked as required, but an admin condition is present, the generated types sets the field to nullable.
Admin UI and API validation will return an error if condition none fulfilled but the generated types set the field as optional.
@qgwr32 In my real case, the condition is related to a another required fields, for example a propriety have a country and a city, both required and the city will not be shown if no country was set. I tested it in both UI and API and there is no case were a propriety can be created without a city, whatever the condition is.
Describe the Bug
When a field of a relationship type is marked as required, but an admin condition is present, the generated types sets the field to nullable.
Admin UI and API validation will return an error if condition none fulfilled but the generated types set the field as optional.
Link to the code that reproduces this issue
https://github.com/bouchaala-sabri/payload
Reproduction Steps
Example
Collection Post
Collection Categories
Generated types
Which area(s) are affected? (Select all that apply)
Not sure
Environment Info
The text was updated successfully, but these errors were encountered: