You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey guys great job on the module. I think I found an issue where the library isn't exactly following JSONAPI spec, though possibly I'm interpreting the spec wrong too.
I tried to do a call to an api endpoint like so { method: destroy, path: '/post/:id/relationships/comments' } with the following payload:
I expected to see that these relationship records would be deleted though I ended up getting an error from my server as the body of the JSONAPI request was missing.
This is due to http method not adding the body for a DELETE request here in the destroy function, which would normally make sense apart from when you're destroying resources that are part of a 'to-many' relationship.
A server MUST respond to PATCH, POST, and DELETE requests to a URL from a to-many relationship link as described below. For all request types, the body MUST contain a data member whose value is an empty array or an array of resource identifier objects.
Obviously because the destroy method does not include the body this will not work in redux-bees. I have tried running the query in a curl request to my laravel JSONAPI server with no problem so it seems at least my PHP JSONAPI library has also interpreted the spec the same as what I have.
The text was updated successfully, but these errors were encountered:
Hey guys great job on the module. I think I found an issue where the library isn't exactly following JSONAPI spec, though possibly I'm interpreting the spec wrong too.
I tried to do a call to an api endpoint like so
{ method: destroy, path: '/post/:id/relationships/comments' }
with the following payload:I expected to see that these relationship records would be deleted though I ended up getting an error from my server as the body of the JSONAPI request was missing.
This is due to http method not adding the body for a DELETE request here in the destroy function, which would normally make sense apart from when you're destroying resources that are part of a 'to-many' relationship.
In the JSONAPI spec in the 'updating to-many relationships' section it says:
Obviously because the destroy method does not include the body this will not work in redux-bees. I have tried running the query in a curl request to my laravel JSONAPI server with no problem so it seems at least my PHP JSONAPI library has also interpreted the spec the same as what I have.
The text was updated successfully, but these errors were encountered: