Noah Settersten commited on
Commit ·
5fc337e
1
Parent(s): f296c58
chore: Remove unused alias; reverse negated if/else
Browse files
lib/medical_transcription_web/components/code_select.ex
CHANGED
|
@@ -3,7 +3,6 @@ defmodule MedicalTranscriptionWeb.Components.CodeSelect do
|
|
| 3 |
An auto-complete select field that allows users to search for codes to add by either `code` or `description`.
|
| 4 |
"""
|
| 5 |
|
| 6 |
-
alias MedicalTranscription.Feedback.CodeFeedback
|
| 7 |
alias MedicalTranscription.Feedback
|
| 8 |
use MedicalTranscriptionWeb, :live_component
|
| 9 |
import MedicalTranscriptionWeb.Components, only: [tag_result: 1]
|
|
@@ -100,12 +99,12 @@ defmodule MedicalTranscriptionWeb.Components.CodeSelect do
|
|
| 100 |
})
|
| 101 |
|
| 102 |
socket =
|
| 103 |
-
if
|
|
|
|
|
|
|
| 104 |
socket
|
| 105 |
|> assign(:selected_code, selected_code)
|
| 106 |
|> assign(:submitted_code_feedback, code_feedback)
|
| 107 |
-
else
|
| 108 |
-
put_flash(socket, :error, "Failed to record feedback")
|
| 109 |
end
|
| 110 |
|
| 111 |
{:noreply, socket}
|
|
|
|
| 3 |
An auto-complete select field that allows users to search for codes to add by either `code` or `description`.
|
| 4 |
"""
|
| 5 |
|
|
|
|
| 6 |
alias MedicalTranscription.Feedback
|
| 7 |
use MedicalTranscriptionWeb, :live_component
|
| 8 |
import MedicalTranscriptionWeb.Components, only: [tag_result: 1]
|
|
|
|
| 99 |
})
|
| 100 |
|
| 101 |
socket =
|
| 102 |
+
if is_nil(code_feedback) do
|
| 103 |
+
put_flash(socket, :error, "Failed to record feedback")
|
| 104 |
+
else
|
| 105 |
socket
|
| 106 |
|> assign(:selected_code, selected_code)
|
| 107 |
|> assign(:submitted_code_feedback, code_feedback)
|
|
|
|
|
|
|
| 108 |
end
|
| 109 |
|
| 110 |
{:noreply, socket}
|