Hi there,
after successful tweaking my API response (adding model roots to the JSON) I am desperately seeking for a way to modify the POST payload from
modelName : { propertyOne : valueOne, propertyTwo : valueTwo }
to
{ propertyOne : valueOne, propertyTwo : valueTwo }
Any idea?
Thanks in advance,
Martin
How about overriding normalizeFindRecordResponse
in your serializer?
To my understanding this would modify the server’s response, right? I need to modify the request!
Damn! How could I not find this? Thank you, @michaelkirk!
Oops! I read too fast
Then, it’s not the normalize
but the serialize
method you should override.
Was my first try, but it turned out that in
serialize: function(snapshot, options) {
var json = this._super(snapshot, options);
}
the JSON was already “flat”! Still a lot to learn…
Regards,
Martin