angular2-jsonapi icon indicating copy to clipboard operation
angular2-jsonapi copied to clipboard

Add a way to remove To-One relationships

Open HennerM opened this issue 7 years ago • 5 comments

HennerM avatar Jan 25 '18 22:01 HennerM

Coverage Status

Coverage increased (+0.3%) to 87.244% when pulling b7334f7c805c0cbfe15c5d293b2390853392429e on remove-relationship into 8b4acbf405ece78b37988a78e4cad6fe528ef0e8 on master.

coveralls avatar Jan 25 '18 22:01 coveralls

What is the logic behind this one? What is a use case when the lib would have to take care of deleting relationships?

If I understood correctly, you want to delete one relationship from a model. In that case a better solution would be deleting the relationship model itself.

safo6m avatar Jun 05 '18 23:06 safo6m

@safo6m I might be wrong but this might be related with the following issue. Let's say you have a tree structure of nodes. Each node can have a parent node and can have multiple children nodes. Let's say you have a "node A" that is the parent of "node B". How do you remove the parent relationship from "node B"?

I didn't had time to test this branch yet, but I'm having this kind of issue in one of my projects right now.

RicardoNeves avatar Jun 06 '18 08:06 RicardoNeves

Would be great if this could get in :smiley:

Removing existing relations is currently not possible and that's a real missing feature

frans-beech-it avatar Apr 15 '19 12:04 frans-beech-it

PR is not complete (anymore). I added the changes to my project, so I could make use of this feature. I needed to check if the relationshipModel did exist in the updateRelationships function as well (line 436).

jevanlingen avatar Apr 19 '19 13:04 jevanlingen