Skip to content

Commit

Permalink
Merge pull request #33 from zproxyz/fix/custom-error-message
Browse files Browse the repository at this point in the history
fix(id-validator): showing custom error message
  • Loading branch information
martin-css authored Oct 31, 2019
2 parents 214236f + 32bb962 commit 4c7a722
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/id-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ IdValidator.prototype.validateSchema = function (
if (!(self instanceof IdValidator) || self.enabled) {
if (Object.keys(conditionsCopy).length > 0) {
var instance = this

conditionsCopy = clone(conditions)
traverse(conditionsCopy).forEach(function (value) {
if (typeof value === 'function') {
this.update(value.call(instance))
}
})
}

return validateFunction(this, connection, refModelName,
value, conditionsCopy, resolve, reject, allowDuplicates)
}
Expand All @@ -102,7 +102,7 @@ function executeQuery (query, conditions, validateValue, resolve, reject) {
reject(err)
return
}
return count === validateValue ? resolve(true) : reject(false)
return count === validateValue ? resolve(true) : resolve(false)
})
}

Expand Down

0 comments on commit 4c7a722

Please sign in to comment.