kurko / ember-json-api

JSON API adapter for Ember Data.
MIT License
254 stars 62 forks source link

Stop using pushPayload for extracting linked relations, allow RESTSerializer to handle them #23

Closed raycohen closed 9 years ago

raycohen commented 10 years ago

linked is extracted and pushed into the store (pushPayload) before the newly created record responsible for the request gets its id set

the result is a duplicate model with the same id with but with broken associations

related issue in ember-data, but even once it is fixed, this will still be a problem https://github.com/emberjs/data/pull/2210

Do not merge until the 2210 PR is resolved.

cc @denisnazarov

egeriis commented 10 years ago

Until this PR is merged, how do I handle linked resources? I suppose it covers this error:

You cannot use `store#pushPayload` without a type unless your default serializer defines `pushPayload`
denisnazarov commented 10 years ago

@egeriis seems like this may be unrelated. Where are you seeing this error? I think a type is specified wherever pushPayload is used internally.

egeriis commented 10 years ago

Comment removed by admin.

egeriis commented 10 years ago

Comment removed by admin.

kurko commented 9 years ago

@raycohen what's the status of this? emberjs/data#2210 was closed.

jonkoops commented 9 years ago

Since we are moving to Ember Data's built in JSONAPISerializer I think this pull request is no longer necessary. I'm going ahead an close it. If you feel this is unjust please let me know.