-
Notifications
You must be signed in to change notification settings - Fork 96
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
Can't use mongoose plugin based on pre with patch or put #178
Comments
When you do your After your Try making the |
Yes, now I'm only using patch. The thing is that only on post the slug is being created, patch ignores the pre.('validate', function) of the plugin. |
I created a plugin that works with mongoose and feathers that solves this issue https://github.com/ellipticaldoor/slugify-mongoose |
@ellipticaldoor this is why we usually do validation in hooks instead of relying on mongoose. The |
@ekryski yes! I see it more clearly now. The problem for me in this case was that I had to share the schema with other app. |
I have the exact same problem, see #395 |
I'm using this plugin for generating an slug https://github.com/mindblaze/mongoose-url-slugs
(I also tried 10 different plugins with the same result)
I have this when I do a "get" to http://localhost:3030/posts/58e77fb2bdce58efa796f183
If I do a "put" (update in hooks) to the same url with this fields:
I get this response:
"createdAt" and "slug" disappeared, of course with "patch" this doesn't happens but then I can't generate my slug. 😕
How I can solve this? Should be good to force an update to patch? This can be possible?
I think the problem is that path is not calling the mongoose event 'validate'
The text was updated successfully, but these errors were encountered: