Custom actions not receiving URL params #556
Comments
Hi, I get the same issue for my current project. When using post/put method, the 'id' param become a request payload. |
@Riari Hi, just curios, were you able to find a solution to this issue? |
No, sorry. :/ |
I have the same problem. @Riari have you find any workaround for this issue? |
I found out what was happening @Riari. The actual call should be
It is because if you only pass one parameter in, the resource will threat it like a body object for any method that uses the HTTP verbs POST, PUT, PATCH. Only if you pass two objects in, it will threat the first one as a params object. I wonder if there is a better approach to this because it seems to me a little confusing, specially when the docs shows a wrong example. |
Well spotted @gabrielaraujof. Maybe in a future version, it should simply take one object with optional |
Yeah, I agree. I can take this |
Added a note explaining the use of custom actions (POST, PUT, and PATCH) for when passing single object in. Closes pagekit#556
Added a note explaining the use of custom actions (POST, PUT, and PATCH) for when passing single object in. Closes pagekit#556
Hi,
I can't get custom actions on a resource to work correctly. I have the following
resources.js
:I'm importing it in a component and using it like this:
But this results in a request to
/api/character/set-main
, whereas it should be/api/character/559460/set-main
. I've tried changing the URL structure to place the ID param at the end - same result. Also tried using the example given in the docs:Same result. This is on vue-resource 1.2.0.
The text was updated successfully, but these errors were encountered: