Open ConsoleTVs opened 4 years ago
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 PATCHaddRelated
action, to do a POSTremoveRelated
action, to do a DELETEAll three would take the same arguments:
parent
: resource identifier object (with type and id properties)relationship
: string with the name of the relationshipdata
: one record or array of recordsI've started work on this. You can view it here: https://github.com/geoidesic/reststate-vuex/tree/support-for-relationships https://github.com/geoidesic/reststate-client/tree/support-for-relationships
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.
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.