Skip to content

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

@aburke85

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions