-
Notifications
You must be signed in to change notification settings - Fork 109
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
Error on deleteEntity #60
Comments
I have the same issue. |
That's interesting. I never noted that the spec notes:
That's definitely an oversight. I reckon a quick fix would be a check on status code, as you suggest. The correct solution would probably be to check if there is any data in the response body, but I am not even sure that JSON API allows GET, PATCH and POST response body to be empty. Are you up for making a PR @DanBradbury? |
😄 |
When updating relationships w/
The same is true for creating resources ( I wasn't aware of any 204s until this morning and can submit a PR to take a look at the status code. I'm under the impression that whenever we have a |
No, I think you're right. At least that would fall out of scope, as the API doesn't follow the spec then. |
I went ahead and took a stab at taking care of this. Please review PR #61 |
I'm having this same issue, our JSON-API serializer (https://github.com/fortunejs/fortune-json-api) seems to return
|
I forgot to close the issue 🙂 Expected it to be closed automatically. |
I'm getting a strange error when deleting a resource using
deleteEntity
.from
utils.js
The
DELETE
request is successful and the server responds with204 No Content
Since the server is correctly implementing the jsonapi spec for delete (using
jsonapi-resources
) I'd expect there to be no problem when the response is handled byredux-json-api
We were thinking this could have just been an issue with a missing
Content-Type
header but from the HTTP/1.1 RFC we see thatContent-Type
isn't even mandatory when content is available.From reading up on
jsonapi-resources
they made a conscious decision to not includeContent-Type
on204 No Content
which makes sense to me (no content is coming back in the response so why provide aContent-Type
for something that doesn't exist)Is this something that should be fixed on the server side? Or would it make more sense to adjust the above code to handle the
res.status === 204
case?The text was updated successfully, but these errors were encountered: