json_api_client icon indicating copy to clipboard operation
json_api_client copied to clipboard

Allow custom_enpoint method and route to be different

Open hildevestol opened this issue 8 years ago • 1 comments

Scenario:

I have to custom_endpoints with the same name. One for PUT and one for DELETE I cannot fint a way to use custom_endpoints for this, because custom_endpoints sets the path/route and method to the same.

custom_endpoint :cancellation, on: :member, request_method: :put
custom_endpoint :cancellation, on: :member, request_method: :delete

calling MyObject.cancellation will result in a delte request and I have not found a way of calling the put request. There should be another param to differ between path and method name

custom_endpoint :cancel, path: :cancellation, request_method: :put
custom_endpoint :reactivate, path: :cancellation, request_method: :put

allowing MyObject.cancel and MyObject.reactivate using the correct path and request_method.

hildevestol avatar Feb 24 '17 08:02 hildevestol

+1 In my case I would like to create the method apply but the path to be /actions/apply

skierkowski avatar Sep 15 '17 00:09 skierkowski