-
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
Solved: How to add relationship #80
Comments
I got it working finally! I updated my code above. Don't know why it wasn't working like that from the beginning(must have made some silly error). |
You have to return function(hook) {
if(hook.result) {
return hook.app.service('items').get(1).then(item => {
hook.result.addInventory(item);
});
}
}; |
Yes you are right, actually i also added this in my code but forgot to update the code above. Also even |
After several days i don't know what to do anymore. My use case is simple:
According to the sequelize docs we just call the appropiate prototype function.
Let's say we have an after hook as following:
FYI, this is the model relation definition(vice versa for items):
The text was updated successfully, but these errors were encountered: