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

Unable to use fields with a POST/PUT request #177

Open
simonc opened this issue May 28, 2019 · 1 comment
Open

Unable to use fields with a POST/PUT request #177

simonc opened this issue May 28, 2019 · 1 comment

Comments

@simonc
Copy link

simonc commented May 28, 2019

Hello there,

We've been experiencing an issue with Devour where passing fields: { comments: 'title' } will not get serialized for create or update calls.

For GET requests it will pass fields[comments]=title but for other types of requests it will send fields={"comments": "title"}.

I could track this issue down to those lines:

https://github.com/twg/devour/blob/e27377c3b5734ae026ff770477fee608c2f4d936/src/middleware/json-api/rails-params-serializer.js#L6-L13

I suppose that this kind of if has a reason for being present but I didn't find one.

  1. Is there a way to change this behavior without having to fork/patch Devour?
  2. Would you be interested in a PR to remove the if ?

Thanks ❤️

@Auspicus
Copy link
Collaborator

Auspicus commented Jul 26, 2019

@simonc I'd be interested in getting a PR out removing the if. I'm not sure what the JSON:API spec is related to this, maybe it only allows for field parameters with GET requests?

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