次の保存があります。
var saveResponse = rene.save({
success: function(response, opts) {
console.log('The Child was saved, response: '+response);
},
failure: function(response, opts) {
console.log('The Child save was a failure response: '+response);
console.log('The Child save was a failure opts: '+opts);
}
});
サーバーは送信されたデータを検証し、エラーが発生した場合はこれを返します。
{"validationErrors":{
"phoneNumber":"Account with this email already exists",
"birthDateString":"Use following format: yyyy-MM-dd. Example: 2012-11-22"}
}
ただし、save メソッドには次の API のみが返されます。
http://docs.sencha.com/touch/2-0/#!/api/Ext.data.Model-method-save
"...それらはすべて、モデルと操作を引数として呼び出されます。",
だから私の質問は:
モデルのみを提供する場合、応答(上記のJSON)を取得するにはどうすればよいですか(完全なモデルを返さないため、投稿本文で送信した元のjsonのみが返されると思います)?それは私が見落としているものですか、それとも意味論的な観点からのREST POSTリクエストが失敗するべきではありませんか(ここでは検証エラー)?