Open behnoodk opened 8 years ago
Yea there are definitely some issues with hasandbelongstomany. Also any use of "through"
We ideally need to start with some failing tests and take it from there.
Do you have any time to do this?
Ps thanks for reporting! (and sorry for the slow reply)
I had some other issues with loopback and decided to write my API from scratch with express since it's a small API. Unfortunately I do not have time to do this. I think at the very least it would be good to mention this in the README. this component does a great job for all belongsTo relationships, but acts unexpectedly for other types of relationships.
@behnoodk how do you send this kind of request? I can only send with the attributes
content as body
.
When adding a record through POST which has a
hasAndBelongsToMany
with another model, the component is acting strange. I'm thinking even if this is not supported yet, it should not behave this way:So loopback handles the
belongsTo
relationship correctly. but thehasAndBelongsToMany
is behaving strange. first there is nothing in the response and second when I check the db, it has updated the fieldarticleId
of all the included tags to the id of created article. and when a new article is created, thisarticleId
gets overwritten for all the tags provided in the request.