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

Association not updated automatically need to call separate API for update in associated models #29

Closed
techloverparveen opened this issue Aug 16, 2017 · 1 comment

Comments

@techloverparveen
Copy link

Hi,
I am using Rest-Hapi and it provides functionality to create auto API for association. But just wondering to know why it not update the associated model with the single call. We need to call the separate API for updating associated model.
For example:-
Suppose i have may to many association between FirstResponder and Occupants , so as Occupant call the API for assigning the FR , so i need FR _id into Occupant and Occupant _id into FR, but for that i need to call to separate API from front-end, first that update FR _id into occupant and after the response (then block ) of that API i called another API that update Occupant _id into FR (FirstResponder). So if i am not wrong means if both have many to many association than automatically the association handling should be there means i just made one call and to whom the model is associated auto updated with the other model _Id.

Any explanation is much appreciated on this.

Thanks

@JKHeadley
Copy link
Owner

You should only have to call the API once to update the association. There was a bug in a previous version that required two API calls to update an association, but this has since been fixed.

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