Closed mtimofiiv closed 7 years ago
See https://github.com/mindblaze/mongoose-url-slugs/issues/28
Basically, if, for whatever reason, you need the slugger to run on a pre-save instead of pre-validate (say, for example, you skip validation in a particular spot but still need a slug), you can specify this when mounting the plugin to the schema:
Product.plugin(urlslugs('name', { onHook: 'save' }));
Thanks, merging.
See https://github.com/mindblaze/mongoose-url-slugs/issues/28
Basically, if, for whatever reason, you need the slugger to run on a pre-save instead of pre-validate (say, for example, you skip validation in a particular spot but still need a slug), you can specify this when mounting the plugin to the schema: