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

Is there a way to remove a relationship? #187

Open
ConsoleTVs opened this issue Apr 24, 2020 · 4 comments
Open

Is there a way to remove a relationship? #187

ConsoleTVs opened this issue Apr 24, 2020 · 4 comments

Comments

@ConsoleTVs
Copy link

How do you remove a to many relationship?

https://jsonapi.org/format/#crud-updating-to-many-relationships

The spect expects a delete request to that URL, but I don't seem to find anything on this package.

@CodingItWrong
Copy link
Contributor

Working with relationship links hasn't yet been implemented in this library.

If you or someone else reading this would like to contribute this feature, I think an API that would work well would be the following actions:

  • setRelated action, to do a PATCH
  • addRelated action, to do a POST
  • removeRelated action, to do a DELETE

All three would take the same arguments:

  • parent: resource identifier object (with type and id properties)
  • relationship: string with the name of the relationship
  • data: one record or array of records

@geoidesic
Copy link

@geoidesic
Copy link

#282

@CodingItWrong
Copy link
Contributor

FYI, this library will be unmaintained going forward.

If you need new features or fixes, I recommend forking the repo and making changes, or finding an alternate library that meets your needs.

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

3 participants