Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated normalizePayload. Please use normalizeResponse. #3676

Closed
workmanw opened this issue Aug 19, 2015 · 3 comments
Closed

Deprecated normalizePayload. Please use normalizeResponse. #3676

workmanw opened this issue Aug 19, 2015 · 3 comments

Comments

@workmanw
Copy link

While upgrading to Ember-data 1.13 I received this error:

serializer.normalizePayload has been deprecated. Please use serializer.normalizeResponse with the new Serializer API to modify the payload.

So I began replacing it as suggested, however during testing I discovered that normalizePayload was previously called via store.pushPayload, but normalizeResponse is not. So those cases where I manually push a payload (eg sockets/realtime) I manually need to normalize first.

Is this intended?

@esbanarango
Copy link
Contributor

👍 @workmanw What did you end up doing here?

@workmanw
Copy link
Author

workmanw commented Jan 6, 2016

@esbanarango I ended up overriding the pushPayload in my serializer and manually calling it.

// app/serializers/application.js
import Ember from 'ember';

export default DS.RESTSerializer.extend({
  // If someone invokes push payload, we want to be sure the data is normalized
  pushPayload(store, payload) {
    payload = this._normalizePayloadData(store, payload);
    return this._super(store, payload);
  }
});

I'd love it if a member of the DS team would weigh in on this. I doubt that this solution would be endorsed.

@runspired
Copy link
Contributor

runspired commented Apr 22, 2018

We did end up removing it in favor of fixing pushPayload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants