--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/c3818f4b-1803-46a4-a1a5-9e293d71caf8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi there,Check https://loopback.io/doc/en/lb3/Nested-queries.html for that.Additionally, you've given the name "model" to the relation going from Parent to Child. Not sure that's what you want, as it'll give you a URL like this: /Parent/{id}/model/{id}/approve which is different from your example.Hope it helps, good luck!
On Wed, Feb 28, 2018 at 7:34 AM, <konst...@bodnia.net> wrote:
Hi everyone!I'm trying to have a remote method described for a specific model exposed as the parent's method nested call (if i'm saying this correctly)Let's say I have two models:parent.json:{ "name": "Parent", "relations": { "model": { "type": "hasMany", "model": "Child" } } }and child.json{ "name": "Child", "relations": { "model": { "type": "belongsTo", "model": "Parent", "foreignKey": "parentId", "options": { "nestRemoting": true } } }, "methods": { "prototype.approve": { "accepts": [], "description": "Approves child", "http": [ { "path": "approve", "verb": "put" } ], "returns": { "arg": "data", "type": "Child", "root": true } } } }That's the setup.Explorer shows me that I have these this method to as the `/Child/{id}/approve` endpoint.But parent model doesn't have it `/Parent{id}/Child/{id}/approve`.What's the best practice to achieve this behaviour?Thanks everyone!
--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+...@googlegroups.com.
GET /Orgs/{id}/orgGroup works fine. But the Second level nested API access for belongsTo relation using prototype.__create__orgGroups_Orgs or prototype.__create__orgGroups__get__Orgs for GET /Orgs/{id}/orgGroup/Orgs does not work.