Permalink
Browse files

KAZOO-544: Correct crossbar transaction reason filter

  • Loading branch information...
1 parent 5864277 commit aa83533036f3cb5af1dea5425f3ba16bc248ab36 Peter Defebvre committed Feb 16, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 whistle_apps/apps/crossbar/src/modules/cb_transactions.erl
View
10 whistle_apps/apps/crossbar/src/modules/cb_transactions.erl
@@ -75,12 +75,12 @@ resource_exists(_) -> true.
validate(#cb_context{req_verb = <<"get">>, query_json=Query}=Context) ->
From = wh_json:get_value(<<"created_from">>, Query, undefined),
Reason = wh_json:get_value(<<"reason">>, Query, undefined),
- case Reason =:= <<"no_call">> of
- false ->
- fetch_by_date(From, Context);
- true ->
+ case Reason of
+ <<"no_call">> ->
Reasons = wh_transaction:get_reasons(false),
- fetch_by_date_and_reason(From, Reasons, Context)
+ fetch_by_date_and_reason(From, Reasons, Context);
+ _ ->
+ fetch_by_date(From, Context)
end.
validate(#cb_context{req_verb = <<"get">>, account_id=AccountId}=Context, <<"current_balance">>) ->

0 comments on commit aa83533

Please sign in to comment.