alias changeset

This commit is contained in:
2022-02-01 00:22:44 -05:00
parent a6a9994b97
commit 3e73f33a6d
11 changed files with 53 additions and 44 deletions

View File

@ -6,6 +6,7 @@ defmodule CanneryWeb.ContainerLive.FormComponent do
use CanneryWeb, :live_component
alias Cannery.Containers
alias Ecto.Changeset
@impl true
def update(%{container: container} = assigns, socket) do
@ -97,7 +98,7 @@ defmodule CanneryWeb.ContainerLive.FormComponent do
|> put_flash(:info, "Container updated successfully")
|> push_redirect(to: socket.assigns.return_to)}
{:error, %Ecto.Changeset{} = changeset} ->
{:error, %Changeset{} = changeset} ->
{:noreply, socket |> assign(:changeset, changeset)}
end
end
@ -110,7 +111,7 @@ defmodule CanneryWeb.ContainerLive.FormComponent do
|> put_flash(:info, "Container created successfully")
|> push_redirect(to: socket.assigns.return_to)}
{:error, %Ecto.Changeset{} = changeset} ->
{:error, %Changeset{} = changeset} ->
{:noreply, socket |> assign(changeset: changeset)}
end
end