author | Clipperz <info@clipperz.com> | 2013-01-18 15:02:39 (UTC) |
---|---|---|
committer | Clipperz <info@clipperz.com> | 2013-01-18 15:02:39 (UTC) |
commit | 969b9f94a25931a765a4cd4765177979f66c1585 (patch) (unidiff) | |
tree | 0b61de265b28c11260dc15256c30184454e7ef08 /frontend/beta | |
parent | fac609cf1507ae82e7069b21724e089a9ac93869 (diff) | |
download | clipperz-969b9f94a25931a765a4cd4765177979f66c1585.zip clipperz-969b9f94a25931a765a4cd4765177979f66c1585.tar.gz clipperz-969b9f94a25931a765a4cd4765177979f66c1585.tar.bz2 |
Fixed error when importing data
-rw-r--r-- | frontend/beta/js/Clipperz/PM/DataModel/User.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/User.js b/frontend/beta/js/Clipperz/PM/DataModel/User.js index b065557..b29d224 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/User.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/User.js | |||
@@ -307,13 +307,18 @@ MochiKit.Logging.logDebug("--- User.saveRecords - 1"); | |||
307 | aRecord.currentVersion().createNewVersion(); | 307 | aRecord.currentVersion().createNewVersion(); |
308 | aRecord.updateKey(); | 308 | aRecord.updateKey(); |
309 | }); | 309 | }); |
310 | MochiKit.Logging.logDebug("--- User.saveRecords - 2"); | 310 | MochiKit.Logging.logDebug("--- User.saveRecords - 2"); |
311 | */ | 311 | */ |
312 | 312 | ||
313 | result = {'records': []}; | 313 | result = { |
314 | 'records': { | ||
315 | // 'deleted': [], | ||
316 | 'updated': [] | ||
317 | } | ||
318 | }; | ||
314 | 319 | ||
315 | deferredResult = new MochiKit.Async.Deferred(); | 320 | deferredResult = new MochiKit.Async.Deferred(); |
316 | c = someRecords.length; | 321 | c = someRecords.length; |
317 | for (i=0; i<c; i++) { | 322 | for (i=0; i<c; i++) { |
318 | deferredResult.addCallback(function(aRecord) { | 323 | deferredResult.addCallback(function(aRecord) { |
319 | if (aRecord.headerNotes() != null) { | 324 | if (aRecord.headerNotes() != null) { |
@@ -364,13 +369,13 @@ MochiKit.Logging.logDebug("--- User.saveRecords - 2"); | |||
364 | aResult['currentRecordVersion'] = res; | 369 | aResult['currentRecordVersion'] = res; |
365 | return aResult; | 370 | return aResult; |
366 | }, recordData); | 371 | }, recordData); |
367 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("User.saveRecords - 6.7 " + res); return res;}); | 372 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("User.saveRecords - 6.7 " + res); return res;}); |
368 | 373 | ||
369 | deferredResult.addCallback(function(aResult, res) { | 374 | deferredResult.addCallback(function(aResult, res) { |
370 | aResult['records'] = { 'updated': [res] }; | 375 | aResult['records']['updated'].push(res); |
371 | return aResult; | 376 | return aResult; |
372 | }, result); | 377 | }, result); |
373 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("User.saveRecords - 6.8 " + res); return res;}); | 378 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("User.saveRecords - 6.8 " + res); return res;}); |
374 | } | 379 | } |
375 | 380 | ||
376 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("User.saveRecords - 7 " + res); return res;}); | 381 | //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("User.saveRecords - 7 " + res); return res;}); |