devour-js / devour-client

Don't just consume your JSON API, Devour it...
https://www.npmjs.com/package/devour-client
ISC License
429 stars 89 forks source link

{'data': {'data': ... }} ??? #144

Closed aars closed 6 years ago

aars commented 6 years ago

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?

tomers commented 6 years ago

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

aars commented 6 years ago

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.