I'm getting unexpected results from a query on an association. When I do a find on my Event class:
Event.find('1')
I get the expected result, and the API query URL is http://localhost:5000/events/1/
When I query for the related 'bookings' on an event like so:
let event = await Event.find('1')
let bookings = await event.bookings().load()
My bookings contains a collection of bookings, but it contains ALL bookings, not just ones for the associated event. When I look at the Chrome 'Network' tab I see that the URL for the bookings request is http://localhost:5000/bookings/.
I would have expected this query to be http://localhost:5000/events/1/bookings/.
Is there a configuration parameter I'm missing? Or is my API routing not configured in a manner that conforms to the standard that the library is expecting? I'm using Ruby on Rails for my back-end if that helps any.
Thanks for creating this library!
I'm getting unexpected results from a query on an association. When I do a find on my Event class:
Event.find('1')
I get the expected result, and the API query URL is
http://localhost:5000/events/1/
When I query for the related 'bookings' on an event like so:
My
bookings
contains a collection of bookings, but it contains ALL bookings, not just ones for the associated event. When I look at the Chrome 'Network' tab I see that the URL for the bookings request ishttp://localhost:5000/bookings/
.I would have expected this query to be
http://localhost:5000/events/1/bookings/
.Is there a configuration parameter I'm missing? Or is my API routing not configured in a manner that conforms to the standard that the library is expecting? I'm using Ruby on Rails for my back-end if that helps any.
Event.js
Booking.js