diff options
author | Garren Smith <garren.smith@gmail.com> | 2014-02-20 11:15:16 +0200 |
---|---|---|
committer | Garren Smith <garren.smith@gmail.com> | 2014-03-03 11:18:42 +0200 |
commit | 9848c76d30b17bdfec68edc28b18ee0fc1b786ab (patch) | |
tree | cadb4f6c469a48e8a12ff1ca27623555129f51ab | |
parent | 0beb91caeb1733d07f920a329ecbe3bb07f55187 (diff) | |
download | couchdb-9848c76d30b17bdfec68edc28b18ee0fc1b786ab.tar.gz |
More improvements
-rw-r--r-- | src/fauxton/app/addons/documents/resources.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/fauxton/app/addons/documents/resources.js b/src/fauxton/app/addons/documents/resources.js index 6f6ed1ca8..d942cf688 100644 --- a/src/fauxton/app/addons/documents/resources.js +++ b/src/fauxton/app/addons/documents/resources.js @@ -26,10 +26,6 @@ function(app, FauxtonAPI) { lastId = '', isView = !!!_isAllDocs, key; - - _.each(doc, function (value, key) { - doc[key] = JSON.stringify(doc[key]); - }); if (currentParams.keys) { throw "Cannot paginate _all_docs with keys"; @@ -39,9 +35,9 @@ function(app, FauxtonAPI) { throw "Require docs to paginate"; } - params = _.reduce(['reduce', 'keys', 'endkey', 'descending', 'inclusive_end'], function (params, p) { - if (_.has(currentParams, p)) { - params[p] = currentParams[p]; + params = _.reduce(['reduce', 'keys', 'endkey', 'descending', 'inclusive_end'], function (params, key) { + if (_.has(currentParams, key)) { + params[key] = currentParams[key]; } return params; }, params); @@ -49,7 +45,6 @@ function(app, FauxtonAPI) { lastId = doc.id || doc._id; if (isView) { - console.log(doc.key, doc, lastId); key = doc.key; docId = lastId; } else { @@ -64,6 +59,13 @@ function(app, FauxtonAPI) { } else { params.startkey_docid = docId; } + + _.each(['startkey', 'endkey', 'key'], function (key) { + if (_.has(params, key)) { + params[key] = JSON.stringify(params[key]); + } + }); + return params; } }; |