couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r793218 - /couchdb/trunk/share/www/script/jquery.couch.js
Date Sat, 11 Jul 2009 21:00:38 GMT
Author: davisp
Date: Sat Jul 11 21:00:38 2009
New Revision: 793218

URL: http://svn.apache.org/viewvc?rev=793218&view=rev
Log:
Only update a document's _id and _rev if the save was successful.

Thanks Jason Davies.


Modified:
    couchdb/trunk/share/www/script/jquery.couch.js

Modified: couchdb/trunk/share/www/script/jquery.couch.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/jquery.couch.js?rev=793218&r1=793217&r2=793218&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/jquery.couch.js [utf-8] (original)
+++ couchdb/trunk/share/www/script/jquery.couch.js [utf-8] Sat Jul 11 21:00:38 2009
@@ -239,9 +239,9 @@
             dataType: "json", data: toJSON(doc),
             complete: function(req) {
               var resp = $.httpData(req, "json");
-              doc._id = resp.id;
-              doc._rev = resp.rev;
               if (req.status == 201) {
+                doc._id = resp.id;
+                doc._rev = resp.rev;
                 if (options.success) options.success(resp);
               } else if (options.error) {
                 options.error(req.status, resp.error, resp.reason);



Mime
View raw message