diff options
author | Paul Joseph Davis <davisp@apache.org> | 2009-07-11 21:00:38 +0000 |
---|---|---|
committer | Paul Joseph Davis <davisp@apache.org> | 2009-07-11 21:00:38 +0000 |
commit | c8612a78358e44d15e89517d188a439fab80a233 (patch) | |
tree | 48a0efa0e2aed4235b5fe4f206fce90351ffedd6 /share/www | |
parent | 83620844f02676e4ee2b17eb6755b24ddc42c07d (diff) |
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
Diffstat (limited to 'share/www')
-rw-r--r-- | share/www/script/jquery.couch.js | 4 |
1 files changed, 2 insertions, 2 deletions
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); |