Fixed issue where params are ignored on update service calls. #235
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a resolution for issue #234. I will paste the content of the issue report below:
Take a look at these two lines:
feathers-sequelize/lib/index.js
Line 244 in 6f5c547
feathers-sequelize/lib/index.js
Line 258 in 6f5c547
Lines like these do overrides such as
raw: false
, which is totally fine, but in the process they also fail to pass through the other attributes of theparams
object that was provided by the original caller of the service method (further up the callstack).When a service call is made by some featherjs user's code, it's important to preserve the
params
object when making any subsequent service calls, as it's possible that the user of feathersjs intends to use these parameters as part of agetModel()
override function in a custom service class (i.e.class MySpecialService extends Service
with an overiddengetModel()
) For things like multi-tenancy schemes (hosting multiple domains/sites out of a single app instance such that each site needs to hit a different database).Any practice of ignoring/clobbering the params passed in will cause problems for such a scheme.
For the most part I have not noticed an issue with this -- As far as I know, get, find, and most other service calls do not have this practice of completely overriding the params with their own value, but update does have this issue. I will submit a pull request for this.