diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-03-09 19:52:54 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-03-09 19:52:54 +0000 |
commit | 610064aea6eb707fe3b6a68f7c93005ceac0a2ec (patch) | |
tree | 432a31e5c0561e10f9b1e4973c2741c5c777c1f1 /src/couchdb/couch_httpd_view.erl | |
parent | dd79e85bc9e4849df904498ca25ec56304440b5f (diff) |
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
Diffstat (limited to 'src/couchdb/couch_httpd_view.erl')
-rw-r--r-- | src/couchdb/couch_httpd_view.erl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/couchdb/couch_httpd_view.erl b/src/couchdb/couch_httpd_view.erl index 6b9befe1..322cf945 100644 --- a/src/couchdb/couch_httpd_view.erl +++ b/src/couchdb/couch_httpd_view.erl @@ -49,13 +49,15 @@ design_doc_view(Req, Db, Id, ViewName, Keys) -> couch_stats_collector:increment({httpd, view_reads}), Result. -handle_view_req(#httpd{method='GET',path_parts=[_,_, Id, ViewName]}=Req, Db) -> - design_doc_view(Req, Db, Id, ViewName, nil); +handle_view_req(#httpd{method='GET', + path_parts=[_Db, _Design, DName, _View, ViewName]}=Req, Db) -> + design_doc_view(Req, Db, DName, ViewName, nil); -handle_view_req(#httpd{method='POST',path_parts=[_,_, Id, ViewName]}=Req, Db) -> +handle_view_req(#httpd{method='POST', + path_parts=[_Db, _Design, DName, _View, ViewName]}=Req, Db) -> {Props} = couch_httpd:json_body(Req), Keys = proplists:get_value(<<"keys">>, Props, nil), - design_doc_view(Req, Db, Id, ViewName, Keys); + design_doc_view(Req, Db, DName, ViewName, Keys); handle_view_req(Req, _Db) -> send_method_not_allowed(Req, "GET,POST,HEAD"). |