Created
November 5, 2014 12:51
-
-
Save ohadlevy/28a00b775d7242b85719 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DS from 'ember-data'; | |
export default DS.RESTSerializer.extend({ | |
extractArray: function(store, type, payload) { | |
// 'foreman-experimental-ui@model:setting:' | |
var wrapped_payload = {}; | |
var model_name = type.toString().split(":")[1]; | |
wrapped_payload[model_name] = payload['results']; | |
// TODO: handle additional API result (params, counters etc) | |
return this._super(store, type, wrapped_payload); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment