Skip to content

Commit

Permalink
improve SurveyLogEntry.normalize_mode_field funciton
Browse files Browse the repository at this point in the history
  • Loading branch information
anaPerezGhiglia committed Jul 19, 2024
1 parent 68d89f6 commit c2577a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ask/survey_log_entry.ex
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ defmodule Ask.SurveyLogEntry do
end

defp normalize_mode_field(changeset) do
downcase_mode_field = String.downcase(get_field(changeset, :mode))
formatted_mode = case downcase_mode_field do
mode_field = get_field(changeset, :mode)
formatted_mode = case String.downcase(mode_field) do
"sms" -> "SMS"
"ivr" -> "IVR"
"mobileweb" -> "Mobile Web"
other -> other
_ -> mode_field
end
changeset |> put_change(:mode, formatted_mode)
end
Expand Down

0 comments on commit c2577a3

Please sign in to comment.