-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I retrieve Many-to-Many data #30
Comments
Can you please provide some sample code (we can do this offline if you'd like). I want to fix the two issues you have open, but it looks like maybe it's better for me to create an entire test suite around it. If you can just provide me your models I can make the tests. For many-to-many support, I think it makes sense to have an extended URL format that looks something like: https://localhost:3000/api/category/item/ where Category.hasMany(Item). This definitely hasn't been implemented yet, but I think is a good idea. |
|
@burakkilic thank you for the models, I will be out of town for the next ten days but will try to incorporate these into tests asap. |
Thanks @mbroadst |
We could theoretically add support for something like Either way, I wonder if we might want to require that users explicitly opt-in to enable/expose these traversals with something like: var items = epilogue.resource({
model: Item,
endpoints: ['/items', '/items/:id'],
associations: [Category]
}); |
Well, I haven't had a chance to take a good look at it yet, but to a certain degree just passing the right models into the "includes" should work as-is. I might be reading the initial question incorrectly though. I would try:
What I'd ideally like to do in the future for all associations is:
|
@burakkilic ping, have you tried my suggestion? |
@mbroadst could you create an issue for us to track the progress of the association routing feature? |
@breandr looks like someone beat both of us to it: #34. I'll track the work there |
Hi;
I have many-to-many categories-items relation.
I want to retrieve the items that belongs to a category.
I make a request with "/items?CategoryId=1"
But I am getting
because relationship is saved in category_items table.
How can I retrieve the associated data in many-to-many relationships.
The text was updated successfully, but these errors were encountered: