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

Better error messages when unique validation fails (mongodb) #1857

Merged
merged 4 commits into from
Oct 31, 2019

Conversation

Vultraz
Copy link
Contributor

@Vultraz Vultraz commented Oct 28, 2019

Should close #433 since the error appears.

This utilizes mongoose-unique-validator as a global schema plugin. Test done with a unique URL field.

Before
image

After
image

@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2019

🦋 Changeset is good to go

Latest commit: 9d685ad

We got this.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Vultraz Vultraz force-pushed the mongoose-error-unique branch from 3f43399 to aff3a7b Compare October 28, 2019 19:47
@MadeByMike
Copy link
Contributor

Thanks Charles you're on fire! This is good but won't close #433 as I believe that's more about having a visual indication in the UI.

@MadeByMike
Copy link
Contributor

Looks like this breaks one of our CI test :(

@Vultraz Vultraz force-pushed the mongoose-error-unique branch 5 times, most recently from 0fb6f8d to 6ce5774 Compare October 29, 2019 03:00
@Vultraz
Copy link
Contributor Author

Vultraz commented Oct 29, 2019

@MadeByMike Fixed (besides the unrelated random failure)! Also fixed the deprecation warning about testResultsProcessor at the end of the tests.

@Vultraz Vultraz force-pushed the mongoose-error-unique branch from 6ce5774 to 3e43113 Compare October 31, 2019 02:23
@Vultraz Vultraz changed the title Better error messages when unique validation fails Better error messages when unique validation fails (mongodb) Oct 31, 2019
@MadeByMike MadeByMike self-requested a review October 31, 2019 21:30
@MadeByMike MadeByMike merged commit ba8aef7 into keystonejs:master Oct 31, 2019
This was referenced Oct 31, 2019
@Vultraz Vultraz deleted the mongoose-error-unique branch May 20, 2020 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Surface isUnique constraint errors in Admin UI
2 participants