Closed Maan511 closed 5 years ago
Can you build a small example? you are using new() or edition a received resource?
Hi @pablorsk
It is a received resource.
The problem occurs when I:
.save()
on one of the resources. Then "relationship-name": { "data": { } }
is sent to the server.I believe it originates from here: https://github.com/reyesoft/ngx-jsonapi/blob/dd6b0a721cba0f1231152c9528239e48eac6e3c6/src/resource.ts#L87
I will try to build an example, as soon as time allows it.
I think we can close this issue, since #141 fixed empty relationships structure...
When saving a resource with an optional to-one relationship which has not been set, a relationship object with an empty data attribute is sent to the server, along with other updates.
If I understand the documentation correctly, this is not valid.
In my case where the relationship is not set to a resource, I would expect the
Part
relationship object to be left out of the update request,