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

Update transaction_modal_component.ex #2

Merged
merged 2 commits into from
May 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions lib/monis_app_web/live/components/transaction_modal_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@ defmodule MonisAppWeb.TransactionModalComponent do

def handle_event(
"change-forms",
%{"_target" => targets, "account" => search_term} = params,
%{"_target" => ["account"], "account" => search_term} = params,
socket
) do
socket =
if "account" in targets do
assign(socket, :accounts, Finance.search_accounts(search_term))
else
socket
end
{:noreply, assign(socket, :accounts, Finance.search_accounts(search_term))}
end

def handle_event("change-forms", _, socket) do
{:noreply, socket}
end
end