Skip to content

Instantly share code, notes, and snippets.

@sultaniman
Last active May 7, 2019 21:32
Show Gist options
  • Save sultaniman/124fa3538d6fd29bea47f924f99b26b8 to your computer and use it in GitHub Desktop.
Save sultaniman/124fa3538d6fd29bea47f924f99b26b8 to your computer and use it in GitHub Desktop.
process errors helper
def process_errors(%Changeset{} = changeset) do
%{
message: "Changeset errors occurred",
code: :schema_errors,
errors: to_api_errors(changeset)
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment