mirror of
https://github.com/ash-project/ash_json_api_wrapper.git
synced 2024-09-20 05:12:51 +12:00
improvement: handle the case where fields is nil
This commit is contained in:
parent
3f866f3398
commit
3b1a8eaef1
1 changed files with 1 additions and 1 deletions
|
@ -683,7 +683,7 @@ defmodule AshJsonApiWrapper.DataLayer do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp get_field(resource, endpoint, field) do
|
defp get_field(resource, endpoint, field) do
|
||||||
Enum.find(endpoint.fields, &(&1.name == field)) ||
|
Enum.find(endpoint.fields || [], &(&1.name == field)) ||
|
||||||
Enum.find(AshJsonApiWrapper.fields(resource), &(&1.name == field))
|
Enum.find(AshJsonApiWrapper.fields(resource), &(&1.name == field))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue