Skip to content

Parent relationship not working as in HTTP Adapter #23

Open
@JoaoMosmann

Description

@JoaoMosmann

I'm not sure if it's on purpose. But I thought that by defining a resource as belonging to another resource using the property parent: true It would behave as in the HTTP Adapter which mounts the endpoint relative to its parent.

If this is a planned feature that was forgotten, I can do a PR. If not, why ?

e.g:

var Comment = store.defineResource({
  name: 'comment',
  relations: {
    belongsTo: {
      post: {
        parent: true,
        localKey: 'postId',
        localField: 'post'
      }
    }
  }
});

Comment.find(5, { params: { postId: 4 } }); // GET /post/4/comment/5

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions