something is working
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
/*!
|
||||
* ignore
|
||||
*/
|
||||
|
||||
module.exports = function(schema) {
|
||||
// `this.$__.validating` tracks whether there are multiple validations running
|
||||
// in parallel. We need to clear `this.$__.validating` before post hooks for gh-8597
|
||||
const unshift = true;
|
||||
schema.s.hooks.post('validate', false, function() {
|
||||
if (this.$isSubdocument) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.$__.validating = null;
|
||||
}, unshift);
|
||||
|
||||
schema.s.hooks.post('validate', false, function(error, res, next) {
|
||||
if (this.$isSubdocument) {
|
||||
next();
|
||||
return;
|
||||
}
|
||||
|
||||
this.$__.validating = null;
|
||||
next();
|
||||
}, unshift);
|
||||
};
|
||||
Reference in New Issue
Block a user