Skip to content
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

Body payload is appending to the url query string instead of request body #75

Open
eddypjr opened this issue Nov 11, 2021 · 1 comment

Comments

@eddypjr
Copy link
Contributor

eddypjr commented Nov 11, 2021

When can-ajax is used with the PATCH method, the body payload should append to the request body, not the url query string.

  • POST and PUT are working as expected, but sending a JSON payload with PATCH is not.
  • ajax({ url: ``${loader.serviceBaseURL}/carrito_articulo?${pk.toString()}``, type: 'PATCH', data: {foo: 'bar'} })
@gregorgodoy
Copy link

gregorgodoy commented Nov 11, 2021

I think we have to change line 221

from

var isPost = type === "POST" || type === "PUT"

to

var isPost = type === "POST" || type === "PUT" || type === "PATCH"

I tried it locally and works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants