Using returning promise instead of callbacks

This commit is contained in:
Andrey Hohutkin 2019-10-29 09:41:23 +02:00 committed by GitHub
parent c51c6b06c5
commit 42d4543802
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,8 +130,7 @@ module.exports = ({ models, target, plugin = false }, ctx) => {
if (_.isFunction(target[model.toLowerCase()][fn])) {
schema.pre(key, function(next) {
return target[model.toLowerCase()]
[fn](this)
.then(next);
[fn](this);
});
}
});