You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HasAndBelongsToMany relation Model.relationName.link() method not working as expected #145
I created two models Car and Tag linked with _hasAndBelongsToMany relation. Trying to link to instances of these models issue a 404 error message. Because fk paramater is not setted propoerly by angular sdk client lib.
I created some sample data (cars and tags) on database (tested with memory and mongodb connectors).
When i call api on client side, angular lib must make a PUT http request to link my to models instances. Infortunately, ng-lib seems make a bad request.
"error":{"name":"Error","status":404,"message":"No relation found in CarTag for (Car.1,Tag.rel)","statusCode":404,"stack":"Error: No relation found in CarTag for (Car.1,Tag.rel)}
When I spying the request I can see :
Remote Address:127.0.0.1:3000
Request URL:http://localhost:3000/api/cars/1/tags/rel
Request Method:PUT
Status Code:404 Not Found
Request Playload : {"id":1,"fk":1}
Doing the same taks on api explorer works and reveals that correct PUT Request should be :
Activity
mikamboo commentedon Apr 27, 2015
@jasonaden found the solution.