couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [10/15] couchdb-nano git commit: ct: Allow body to be optional in db.atomic.
Date Wed, 11 Jan 2017 11:45:57 GMT
ct: Allow body to be optional in db.atomic.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/6b5d7238
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/6b5d7238
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/6b5d7238

Branch: refs/heads/master
Commit: 6b5d72388030f4ab095995307cc7df684446a67a
Parents: f757cdd
Author: Chris Taylor <ctaylorr@gmail.com>
Authored: Sat Apr 23 00:54:54 2016 -0400
Committer: Glynn Bird <glynn.bird@gmail.com>
Committed: Wed Oct 26 14:36:24 2016 +0100

----------------------------------------------------------------------
 lib/nano.js | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/6b5d7238/lib/nano.js
----------------------------------------------------------------------
diff --git a/lib/nano.js b/lib/nano.js
index cf6f709..79ea56e 100644
--- a/lib/nano.js
+++ b/lib/nano.js
@@ -562,6 +562,10 @@ module.exports = exports = nano = function dbScope(cfg) {
 
     // http://docs.couchdb.org/en/latest/api/ddoc/render.html#put--db-_design-ddoc-_update-func-docid
     function updateWithHandler(ddoc, viewName, docName, body, callback) {
+      if (typeof body === 'function') {
+          callback = body;
+          body = undefined;
+      }
       return view(ddoc, viewName + '/' + encodeURIComponent(docName), {
         type: 'update',
         method: 'PUT',


Mime
View raw message