Skip to content

Commit

Permalink
fix: Compiler warnings for zero-arity funtion calls (#335)
Browse files Browse the repository at this point in the history
* Fix compiler warnings
  • Loading branch information
TylerPachal authored Sep 22, 2024
1 parent 849744c commit 49ed6ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/jsonapi/plugs/query_parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ defmodule JSONAPI.QueryParser do

@spec get_valid_fields_for_type(Config.t(), String.t()) :: list(atom())
def get_valid_fields_for_type(%Config{view: view}, type) do
if type == view.type do
view.fields
if type == view.type() do
view.fields()
else
get_view_for_type(view, type).fields
end
Expand All @@ -296,7 +296,7 @@ defmodule JSONAPI.QueryParser do
@spec field_valid_for_relationship?({atom(), module()}, String.t()) :: boolean()
defp field_valid_for_relationship?({key, view}, expected_type) do
cond do
view.type == expected_type ->
view.type() == expected_type ->
true

Atom.to_string(key) == expected_type ->
Expand Down

0 comments on commit 49ed6ab

Please sign in to comment.