partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 2549dc69b6be10ba97868788860297332c5e28c2
parent 806256a17f61e3e057cc1022092dee707728fadd
Author: Felicitus <felicitus@felicitus.org>
Date:   Fri, 11 Sep 2015 19:06:58 +0200

Don't serialize the idProperty field if the record is phantom

Diffstat:
Msrc/PartKeepr/FrontendBundle/Resources/public/js/Data/HydraModel.js | 13++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Data/HydraModel.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Data/HydraModel.js @@ -12,9 +12,20 @@ Ext.define("PartKeepr.data.HydraModel", { * @param {Object} parameters (optional) The parameters as JS object * @param {Function} callback (optional) A callback function */ - callAction: function (action, parameters, callback) { + callAction: function (action, parameters, callback) + { var proxy = this.getProxy(); proxy.callAction(this, action, parameters, callback); + }, + getData: function (options) + { + var data = this.callParent(options); + + if (this.phantom) { + delete data[this.idProperty]; + } + + return data; } }); \ No newline at end of file