Skip to content

Wrong url if fetch ($find) single item in nested resource #382

Description

@aburke85

I have 2 models defined:

Blog:
restmod.model("/blog").mix({
    posts: { hasMany: 'Post' }
});

Post:
restmod.model("/posts");

I use a slug as primary key for both models and only the combination is unique.

The request of all post uses the correct url (/blog/blogSlug/posts).

Blog.$new(blogSlug).posts.$refresh();

The request of a single posts of the nested resource uses the url of the unnested resource (/posts/postSlug)

Blog.$new(blogSlug).posts.$find(postSlug)

What I am doing wrong or how could i request the single post?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions