Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add unique validator to headless cms #2166

Merged
merged 10 commits into from Jan 4, 2022
Merged

feat: add unique validator to headless cms #2166

merged 10 commits into from Jan 4, 2022

Conversation

brunozoric
Copy link
Contributor

@brunozoric brunozoric commented Jan 3, 2022

Changes

Closes #1939

Be careful when using DynamoDB only project and this validator as it loads all the records in given model and then checks for the uniqueness.

If a value is not passed to the unique validator, nothing happens. If users want some value to be present in the unique field, they must set the required validator on that field.

How Has This Been Tested?

Jest and manually.

Documentation

Added note in the changelog: https://deploy-preview-375--webiny-docs.netlify.app/docs/release-notes/5.22.0/changelog#added-unique-validator-for-cms-model-field-2166

Upgrade

Need to write an upgrade to add unique validator to user project apps/admin/code/src/plugins/headlessCMS.ts.

@brunozoric brunozoric added this to the 5.22.0 milestone Jan 3, 2022
@brunozoric brunozoric self-assigned this Jan 3, 2022
@brunozoric brunozoric merged commit 084f68d into next Jan 4, 2022
@brunozoric brunozoric deleted the feat/issue-1939 branch January 4, 2022 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unique Field Validator in Content Models
1 participant