BlairAllegroTech / js-data-jsonapi

JsonApi Adapter for js-data
MIT License
15 stars 5 forks source link

Code to Serialization Data as JsonApi does not handle relationships correctly #22

Closed BlairAllegroTech closed 8 years ago

BlairAllegroTech commented 8 years ago

As relationship fields in js-data are not enumerable we must instead enumerate the relationships and try to retrieve them from the object.

BlairAllegroTech commented 8 years ago

If relationships exist we can optionally include them in the response if the new options:

return ds.save('author', author.id, { jsonApi: { updateRelationships: true } });