Fix bug in docs list

Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/14dac8d8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/14dac8d8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/14dac8d8

Branch: refs/heads/import-master
Commit: 14dac8d82e27dbef45d6d3a8a5f456dd6b038233
Parents: 797f8fe
Author: Garren Smith <[email protected]>
Authored: Fri Apr 25 10:57:26 2014 +0200
Committer: Garren Smith <[email protected]>
Committed: Fri Apr 25 10:57:26 2014 +0200

----------------------------------------------------------------------
 app/addons/documents/resources.js | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/14dac8d8/app/addons/documents/resources.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/resources.js 
b/app/addons/documents/resources.js
index eb6615a..99e79a2 100644
--- a/app/addons/documents/resources.js
+++ b/app/addons/documents/resources.js
@@ -372,10 +372,20 @@ function(app, FauxtonAPI, PagingCollection) {
 
       // remove any query errors that may return without doc info
       // important for when querying keys on all docs
-      resp.rows = _.filter(rows, function(row){
+      var cleanRows = _.filter(rows, function(row){
         return row.value;
       });
 
+      resp.rows = _.map(cleanRows, function(row){
+        return {
+          _id: row.id,
+          _rev: row.value.rev,
+          value: row.value,
+          key: row.key,
+          doc: row.doc || undefined
+        };
+      });
+
       return PagingCollection.prototype.parse.call(this, resp);
     }
   });

Reply via email to