-
Notifications
You must be signed in to change notification settings - Fork 75
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
How check associations? #127
Comments
Feathers hooks work with POJO's not with DB ORM's, and your If you really can't use const dehydrate = require('feathers-sequelize/hooks/dehydrate');
hooks.after.find = [dehydrate(), discard('password')] You can convert back to an ORM (if you really need to). https://github.com/feathersjs/feathers-sequelize/tree/master/src/hooks |
I think include shouldn't be registered as a before and after hook. If you set I'm going to reopen for now because I think this might be worth looking into a little more (unless I'm missing something and @eddyystop already provided everything that is needed). Related Stackoverflow question: https://stackoverflow.com/questions/44593261/how-to-check-associations-feathers-sequelize-in-service-hook |
@daffl , Thanks for the help. I'll wait for your decision. |
I think this falls under the the umbrella of working with model instances. As soon as someone wants to do something sequelize-specific (such as |
General idea is clear, but the docs confuse me. The 2 ways are documented as alternatives it seems, but in the quoted gist they are both implemented, which is odd (and thus raises a question by someone in the gist, but it is not answered). I suppose alternative 1 (using { raw: false }) would work in both before- and after-hooks, whereas alternative 2 (hydrate (dehydrate)) works only for after-hooks!? A 'general best practice' example would clarify a lot. For after-hooks is it as simple as hydrating before and dehydrating after each customhook (or each sequence of customhooks)? And for before-hooks the 'equivalent' is to set { raw: false } for each customhook? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Apologies if the issue could not be resolved. FeathersJS ecosystem modules are community maintained so there may be a chance that there isn't anybody available to address the issue at the moment. For other ways to get help see here. |
Hi guys, Help me please.
i'am read documentation - https://sequelize.readthedocs.io/en/v3/docs/associations/#check-associations
How to execute a check on the service hook.
The text was updated successfully, but these errors were encountered: