devour-js/devour-client

{'data': {'data': ... }} ???

aars opened this issue · 2 comments

aars commented

This call:
jsonApi.update('case', {id: 100, side: 'top'})

will post this payload:
{'data': {'data': {'attributes': {'side': 'top'}, 'id': 100, 'type': 'case'}, 'meta': {}},

That.... is not correct.

Am I doing something wrong? Or am I looking at a serialisation bug?

Can you please share with us some reproducible code? It's hard to see why this happens from the data provided.

aars commented

Oh wow. Yesterday-me was a moron. Turns out I was looking at the logging output of the server which wrapped the payload in another {data: ... }.

Please ignore yesterday-me :) Thanks.