Skip to content

Commit

Permalink
[base] Convert search api query param type (#623)
Browse files Browse the repository at this point in the history
* Convert search api query param type conversion

* Make queryparam accept integers and atoms
  • Loading branch information
rl-king authored Sep 6, 2019
1 parent c235a3f commit 3ec0f0f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/mod_ginger_base/controllers/controller_search.erl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ argument({upcoming, _Value}) ->
{upcoming, true};
argument({unfinished, _Value}) ->
{unfinished, true};
argument({hassubject, Value}) ->
try list_to_integer(Value) of
Integer -> {hassubject, Integer}
catch
error:_Error -> {hassubject, Value}
end;
argument({hasobject, Value}) ->
try list_to_integer(Value) of
Integer -> {hasobject, Integer}
catch
error:_Error -> {hasobject, Value}
end;
argument(Argument) ->
Argument.

Expand Down

0 comments on commit 3ec0f0f

Please sign in to comment.