GET /model1/:id/model2/:id returns an array of objects (same response as /model1/:id/model2/ (Not expected).
GET /model2/:id returns just one object as expected (Expected).
Model1 has a one to many relationship with Model2.
More specifically, I have 3 sails models with the following one to many relationships:
GET
/model1/:id/model2/:id
returns an array of objects (same response as/model1/:id/model2/
(Not expected). GET/model2/:id
returns just one object as expected (Expected).Model1
has a one to many relationship withModel2
.More specifically, I have 3 sails models with the following one to many relationships:
When I GET
/users/:id/accounts/:id
, I get an array like soI expected this to return a single
Account
object, and not an array containing just oneAccount
object.I get a single
Account
object as expected when I GET/accounts/:id
I also get a singleUser
object as expected when I GET/users/:id/
,My model files look like so
Am I doing it wrong?