From c8612a78358e44d15e89517d188a439fab80a233 Mon Sep 17 00:00:00 2001 From: Paul Joseph Davis Date: Sat, 11 Jul 2009 21:00:38 +0000 Subject: Only update a document's _id and _rev if the save was successful. Thanks Jason Davies. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@793218 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/jquery.couch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share') diff --git a/share/www/script/jquery.couch.js b/share/www/script/jquery.couch.js index 3c629e1d..e974a3c4 100644 --- a/share/www/script/jquery.couch.js +++ b/share/www/script/jquery.couch.js @@ -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); -- cgit v1.2.3