Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save visualjeff/fd0707201fe0e97dcaac1e719354425e to your computer and use it in GitHub Desktop.
Save visualjeff/fd0707201fe0e97dcaac1e719354425e to your computer and use it in GitHub Desktop.
Ember-data override to pull out meta data from a particular data type. Note this is a findAll override. So we're pulling back a collection of locations.
normalizeFindAllResponse(store, primaryModelClass, payload, id, requestType) {
if (primaryModelClass.modelName === 'location') { // My data model in this case is location.
if (payload && payload.hasOwnProperty('meta')) {
let meta = payload.meta;
//Store / persist or do something your meta data.
delete payload.meta;
}
}
return this._super(...arguments);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment