Disable unique or add sparse: true for fields within fields that have conditions #3785
ghardin1314
started this conversation in
Feature Requests & Ideas
Replies: 2 comments 1 reply
-
After further testing it seems like its just |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey @ghardin1314 — good find. Do you need anything here still? Conditions do not, and likely should not, prevent unique from functioning accordingly but we may be able to set unique fields within conditions to I don't think anything has changed here though. I may be wrong, and something did indeed change, but let me know what you think! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Link to reproduction
ghardin1314#1
Describe the Bug
In previous versions of payload, when setting a group with a conditional statement, that conditional statement would also apply to all child fields. This means you could make a child
text
field withunique
orrequired
with no issues. This behavior seems to have changed in new versions of PayloadTo Reproduce
Create a new Post with
postType
of external. The first one should be created no problem. When creating a second Post withpostType
of external you should get the following error:The following field is invalid: internalProps.slug
Payload Version
v2.0.10
Adapters and Plugins
db-mongo
Beta Was this translation helpful? Give feedback.
All reactions