Skip to content

Commit

Permalink
Don't pass in non-empty body when querying view
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Hueras committed Oct 15, 2014
1 parent 00c4a4b commit 9334317
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cberl.erl
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
%%% @author Ali Yakamercan <[email protected]>
%%% @copyright 2012-2013 Chitika Inc.
%%% @version 0.0.2
%%% @version 0.0.3

-module(cberl).
-vsn("0.0.3").
-include("cberl.hrl").

-export([start_link/2, start_link/3, start_link/5, start_link/6, start_link/7]).
Expand Down Expand Up @@ -282,7 +283,7 @@ view(PoolPid, DocName, ViewName, Args) ->
Path = string:join(["_design", DocName, "_view", ViewName], "/"),
Resp = case proplists:get_value(keys, Args) of
undefined -> %% FIXME maybe not have to pass in an empty json obj here
http(PoolPid, string:join([Path, query_args(Args)], "?"), "{}", "application/json", get, view);
http(PoolPid, string:join([Path, query_args(Args)], "?"), "", "application/json", get, view);
Keys ->
http(PoolPid, string:join([Path, query_args(proplists:delete(keys, Args))], "?"), binary_to_list(jiffy:encode({[{keys, Keys}]})), "application/json", post, view)
end,
Expand Down

0 comments on commit 9334317

Please sign in to comment.