Return a single record from a manual read

I'm using a manual read action to wrap an api client around a resource I want to fetch an indivdual record but the get? true only applies to the data layre, how can I instruct the action to return a single record?
1 Reply
Marco Dell'Olio
Marco Dell'OlioOP4mo ago
Interesting so the get? true applies to the calling interface and not the action.
case fetch_person(url) do
{:ok, data} ->
{:ok, [to_person(data)]}

{:error, error} ->
{:error, error}
end
case fetch_person(url) do
{:ok, data} ->
{:ok, [to_person(data)]}

{:error, error} ->
{:error, error}
end
so this correctly resolves to
{:ok, %{} = person} =
{:ok, %{} = person} =

Did you find this page helpful?