Skip to content
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

chore: add functional error responses and tests cases for it #1571

Merged
merged 2 commits into from
Sep 7, 2023

Conversation

sborrazas
Copy link
Contributor

No description provided.

@sborrazas sborrazas requested a review from jyeshe August 31, 2023 12:43
@sborrazas sborrazas self-assigned this Aug 31, 2023
Copy link
Member

@jyeshe jyeshe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and thanks for the additional test cases. One minor suggestion and approved in advance.

Comment on lines 161 to 170
ids_fields =
query
|> Map.get(:ids, MapSet.new())
|> MapSet.to_list()
|> Enum.reduce_while({:ok, []}, fn {field, id}, {:ok, acc} ->
case extract_transaction_by(String.split(field, ".")) do
{:ok, fields} -> {:cont, {:ok, [{id, fields} | acc]}}
{:error, reason} -> {:halt, {:error, reason}}
end
end)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May we have a function to give this block a name? It would be helpful also to turn parameters to be explicit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@sborrazas sborrazas requested a review from jyeshe September 6, 2023 10:48
@sborrazas sborrazas merged commit 5a3bd21 into master Sep 7, 2023
7 checks passed
@sborrazas sborrazas deleted the error-responses branch September 7, 2023 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants