Skip to content

fix: Compiler warnings for zero-arity funtion calls #335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading