Fix conversion for `updateAttributes`
This commit is contained in:
parent
49c2bc214a
commit
ef232eae0a
|
@ -58,11 +58,11 @@ function copyData(from, to) {
|
|||
}
|
||||
}
|
||||
|
||||
function convertDataPropertiesByType(data) {
|
||||
function convertSubsetOfPropertiesByType(inst, data) {
|
||||
var typedData = {};
|
||||
for (var key in data) {
|
||||
// Convert the properties by type
|
||||
typedData[key] = data[key];
|
||||
typedData[key] = inst[key];
|
||||
if (typeof typedData[key] === 'object'
|
||||
&& typedData[key] !== null
|
||||
&& typeof typedData[key].toObject === 'function') {
|
||||
|
@ -2532,7 +2532,7 @@ DataAccessObject.prototype.updateAttributes = function updateAttributes(data, op
|
|||
inst.trigger('save', function (saveDone) {
|
||||
inst.trigger('update', function (done) {
|
||||
copyData(data, inst);
|
||||
var typedData = convertDataPropertiesByType(data);
|
||||
var typedData = convertSubsetOfPropertiesByType(inst, data);
|
||||
context.data = typedData;
|
||||
|
||||
function updateAttributesCallback(err) {
|
||||
|
|
Loading…
Reference in New Issue