Skip to content

[Read Endpoint] Get data from two models #230

@abhishekchotaliya

Description

@abhishekchotaliya

Using association, I can request /book/2/chapters, which will give me chapters data of book 2(But no book data).

But is there any 'hack' by which I can get book data + chapters data from the same url? something like this?

{
    "book": {
        ... all book 2 data ... ,
        "chapters": {
            ... all book 2 chapters data ....
        }
    }
}

If not, then is it possible to get a similar result with the use of middleware?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions