diff options
Diffstat (limited to 'share/www/script/couch.js')
-rw-r--r-- | share/www/script/couch.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/share/www/script/couch.js b/share/www/script/couch.js index f354f52a..af3bb8fb 100644 --- a/share/www/script/couch.js +++ b/share/www/script/couch.js @@ -191,10 +191,18 @@ function CouchDB(name, httpHeaders) { } this.allDocs = function(options,keys) { + return this.builtinView("_all_docs", options, keys) + } + + this.conflicts = function(options,keys) { + return this.builtinView("_conflicts", options, keys) + } + + this.builtinView = function(name, options, keys) { if(!keys) { - this.last_req = this.request("GET", this.uri + "_all_docs" + encodeOptions(options)); + this.last_req = this.request("GET", this.uri + name + encodeOptions(options)); } else { - this.last_req = this.request("POST", this.uri + "_all_docs" + encodeOptions(options), { + this.last_req = this.request("POST", this.uri + name + encodeOptions(options), { headers: {"Content-Type": "application/json"}, body: JSON.stringify({keys:keys}) }); |