From 610064aea6eb707fe3b6a68f7c93005ceac0a2ec Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Mon, 9 Mar 2009 19:52:54 +0000 Subject: merge design doc resource branch. breaking changes to _view query paths. closes COUCHDB-280 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@751813 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/couch.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'share/www/script/couch.js') diff --git a/share/www/script/couch.js b/share/www/script/couch.js index 8a0d3d23..821fb694 100644 --- a/share/www/script/couch.js +++ b/share/www/script/couch.js @@ -142,12 +142,13 @@ function CouchDB(name, httpHeaders) { } this.view = function(viewname, options, keys) { + var viewParts = viewname.split('/'); + var viewPath = this.uri + "_design/" + viewParts[0] + "/_view/" + + viewParts[1] + encodeOptions(options); if(!keys) { - this.last_req = this.request("GET", this.uri + "_view/" + - viewname + encodeOptions(options)); + this.last_req = this.request("GET", viewPath); } else { - this.last_req = this.request("POST", this.uri + "_view/" + - viewname + encodeOptions(options), { + this.last_req = this.request("POST", viewPath, { headers: {"Content-Type": "application/json"}, body: JSON.stringify({keys:keys}) }); -- cgit v1.2.3