You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2020/04/06 22:02:02 UTC

[couchdb] 04/05: Fix POST to _all_docs/queries

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch fix-api-corner-cases-and-make-chttpd-pass
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit cf134b139d324b4f90fd44a5a74a0d200414c9a7
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Mon Apr 6 17:52:05 2020 -0400

    Fix POST to _all_docs/queries
    
    Use the new couch_views module instead of fabric:query_view
---
 src/chttpd/src/chttpd_view.erl | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/chttpd/src/chttpd_view.erl b/src/chttpd/src/chttpd_view.erl
index 84997e5..3ef9c24 100644
--- a/src/chttpd/src/chttpd_view.erl
+++ b/src/chttpd/src/chttpd_view.erl
@@ -26,14 +26,13 @@ multi_query_view(Req, Db, DDoc, ViewName, Queries) ->
         QueryArg1 = couch_mrview_util:set_view_type(QueryArg, ViewName, Views),
         fabric_util:validate_args(Db, DDoc, QueryArg1)
     end, Queries),
-    Options = [{user_ctx, Req#httpd.user_ctx}],
     VAcc0 = #vacc{db=Db, req=Req, prepend="\r\n"},
     FirstChunk = "{\"results\":[",
     {ok, Resp0} = chttpd:start_delayed_json_response(VAcc0#vacc.req, 200, [], FirstChunk),
     VAcc1 = VAcc0#vacc{resp=Resp0},
     VAcc2 = lists:foldl(fun(Args, Acc0) ->
-        {ok, Acc1} = fabric:query_view(Db, Options, DDoc, ViewName,
-            fun view_cb/2, Acc0, Args),
+        Fun = fun view_cb/2,
+        {ok, Acc1} = couch_views:query(Db, DDoc, ViewName, Fun, Acc0, Args),
         Acc1
     end, VAcc1, ArgQueries),
     {ok, Resp1} = chttpd:send_delayed_chunk(VAcc2#vacc.resp, "\r\n]}"),