[Pkg-javascript-commits] [dojo] 99/149: fixes #18704, Return/resolve actual newly created/updated item from dojo/store/DataStore adapter

David Prévot taffit at moszumanska.debian.org
Sat Feb 27 03:13:52 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository dojo.

commit 8b6a5e4c42f9cf777dd39eaae8b188e0ebb59a4c
Author: Shanto <shanto at hotmail.com>
Date:   Sat Nov 28 07:21:37 2015 -0700

    fixes #18704, Return/resolve actual newly created/updated item from dojo/store/DataStore adapter
---
 store/DataStore.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/store/DataStore.js b/store/DataStore.js
index 79407b4..986ef6f 100644
--- a/store/DataStore.js
+++ b/store/DataStore.js
@@ -129,10 +129,10 @@ return declare("dojo.store.DataStore", base, {
 		var idProperty = this.idProperty;
 		var deferred = new Deferred();
 		if(typeof id == "undefined"){
-			store.newItem(object);
+			var item = store.newItem(object);
 			store.save({
 				onComplete: function(){
-					deferred.resolve(object);
+					deferred.resolve(item);
 				},
 				onError: function(error){
 					deferred.reject(error);
@@ -157,11 +157,11 @@ return declare("dojo.store.DataStore", base, {
 						if(options.overwrite === true){
 							return deferred.reject(new Error("Creating new object not allowed"));
 						}
-						store.newItem(object);
+						var item = store.newItem(object);
 					}
 					store.save({
 						onComplete: function(){
-							deferred.resolve(object);
+							deferred.resolve(item);
 						},
 						onError: function(error){
 							deferred.reject(error);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list