normalizeResponse (store, primaryModelClass, payload, id, requestType) Object
The normalizeResponse method is used to normalize a payload from the server to a JSON-API Document.
http://jsonapi.org/format/#document-structure
This method delegates to a more specific normalize method based on the requestType.
To override this method with a custom one, make sure to call return this._super(store, primaryModelClass, payload, id, requestType) with your pre-processed data.
Here's an example of using normalizeResponse manually:
socket.on('message', function(message) {
var data = message.data;
var modelClass = store.modelFor(data.modelName);
var serializer = store.serializerFor(data.modelName);
var normalized = serializer.normalizeSingleResponse(store, modelClass, data, data.id);
store.push(normalized);
});
Parameters:
Returns:
-
Object - JSON-API Document
Please login to continue.