Quantcast
Viewing all articles
Browse latest Browse all 4826

Ember normalize response `undefined` fields

@teckays wrote:

I'm extending the JSONSerializer in order to fit my server response which looks like this:

{
  "result": {
    "items": [
      {
        "id": "...",
        "title": "...",
        ...
      },
      ...
    ],
      "total": number,
      "...": "..."
  }   
}

therefore I have overridden normalizeResponse() method:

normalizeResponse: function(store, primaryModelClass, payload, id, requestType) {
        payload = payload.result.items;

        return this._super(store, primaryModelClass, payload, id, requestType)
    },

after this my model data fields are all undefined. What I'm doing wrong?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4826

Trending Articles