Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Changed hooks to use hook.service instead of this #18

Merged
merged 1 commit into from
Jun 1, 2017

Conversation

salttis
Copy link
Contributor

@salttis salttis commented Jun 1, 2017

Summary

This fixes the problem that hooks lose context of this when used inside
other hooks.

Other Information

Since I haven't contributed to feathers that much, I am not sure if this change is breaking something in older versions. This change depends on that, the hook object contains a service object, that provides the functionality to find, get, create, etc. of the current service that the hook is in.

The tests created the mock service under hook.app and I have now moved it under the hook object.

This fixes the problem that hooks lose context of this when used inside
other hooks.

Fixes feathersjs-ecosystem#17: Hook "restrictToOwner" looses context (this) when wrapped
@daffl daffl merged commit 417fbac into feathersjs-ecosystem:master Jun 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hook "restrictToOwner" looses context (this) when wrapped
3 participants