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

fix(id-validator): showing custom error message #33

Merged

Conversation

zproxyz
Copy link

@zproxyz zproxyz commented Oct 30, 2019

From Mongoose docs

There are two ways for an promise-based async validator to fail:

  1. If the promise rejects, Mongoose assumes the validator failed with the given error.
  2. If the promise resolves to false, Mongoose assumes the validator failed and creates an error with the given message.

In our case with boolean value, we must use resolve instead reject

This PR resolves issue #32

@martin-css martin-css merged commit 4c7a722 into CampbellSoftwareSolutions:master Oct 31, 2019
@martin-css
Copy link
Member

Thanks for the contribution 👍

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.

2 participants