Ember data sends data to a server with an embedded model name.
{
"part" {
"name" : "test1",
"quantity" : 12
}
}
I want the "part" field to be removed from the response so that it looks like this:
{
"name" : "test1",
"quantity" : 12
}
I need this to be generic, so it will work for any model in my store.
ok I found the part that works in the RESTAdapter.
serializeIntoHash: function(data, type, record, options) {
var root = underscore(decamelize(type.typeKey));
data[root] = this.serialize(record, options);
},
I tried to remove the root part
serializeIntoHash: function(data, type, record, options) {
data = this.serialize(record, options);
}
But it does not work, its answer is with {}
source
share