I'm building an API for a cart-like thing with the jsonapi-resources gem, and I need an endpoint to remove an item from the cart.
Currently, I'm assuming that a client consuming this API won't need the actual 'cart items'. Instead it just needs a list of the products that are in the cart.
However, there doesn't seem to be any way to delete something in jsonapi-resources without knowing that thing's ID. I.e. there's no way for a client to remove something from the cart without it knowing the id of the join model.
Basically I need an endpoint that does something like:
DELETE http://example.com/carts/1/cart-items?filter[product]=1
Instead, the only option I can find is
DELETE http://example.com/cart-items/1
Alternatively, I could implement a custom action to handle this, but I've gone through the docs and I can't find a prescribed way of writing custom actions.