-
Notifications
You must be signed in to change notification settings - Fork 74
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
Make params optional #59
Comments
All Feathers service methods run through the normalizer mixin which should set You do have to make sure to get the service via |
@daffl is that expected behavior? I noticed quite a few other methods in other feathers hooks do a check for params (e.g. If this isn't expected behavior, or a concern for this plugin, then happy to close, otherwise also happy to do a PR that runs the checks. |
You shouldn't use the service instance directly. You won't get hooks or real-time events or anything else that Feathers adds (see here). The hook checks are probably a relic from pre-normalization times (I think that was < 1.3). |
@daffl Ok, thanks for the information. Happy to close this |
Thank you for bringing it up. We'll make sure to mention it in more spots in the documentation to make sure it is well known. |
@daffl No worries, thanks for the quick responses. My interpretation was that it was best practice to get it via |
Some of the methods e.g.
get
requireparams
be given (by usingparams.sequelize
). This is fine if dealing with an incoming request or viaapp.service
(I believe) but if using the service directly without going throughapp
it'll throwTypeError: Cannot read property 'sequelize' of undefined
The text was updated successfully, but these errors were encountered: