Skip to content
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

fails hooks wrong return with around #709

Open
joacub opened this issue Mar 7, 2023 · 3 comments
Open

fails hooks wrong return with around #709

joacub opened this issue Mar 7, 2023 · 3 comments

Comments

@joacub
Copy link

joacub commented Mar 7, 2023

all this hooks fails if you use an around hook, why ? because this lib is modifying the context and feathers don't want that.

this should be avoid :

return {...context, data}

that spread fails as feathers detect the original hook changes

@fratzinger
Copy link
Collaborator

feathers-hooks-common currently does not support around hooks, yet.

There's no NextFunction included yet.

@joacub
Copy link
Author

joacub commented Mar 9, 2023

That also sir, but now even using in a normal hook, for example the preventChanges hook modify the context so then the feathers complains with a nasty error. Maybe there is other shooks that modify the context so will happen the same error.

@fratzinger
Copy link
Collaborator

I've released [email protected] with a fix for the regular hook. Please try again with that version and please let me know.

around hooks are on the line and will come in a future release soon.

anthonymunene added a commit to anthonymunene/reservation-apps that referenced this issue May 2, 2023
doesnt look like this hook works with the around hook
see :feathersjs-ecosystem/feathers-hooks-common#709
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants