Skip to content

Commit

Permalink
chore: remove old code
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Sep 15, 2024
1 parent 834da13 commit d00ed5c
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions lib/ash_hq_web/pages/home.ex
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,7 @@ defmodule AshHqWeb.Pages.Home do
socket,
signed_up: false,
contributor_count: Enum.count(contributors),
contributors: contributors,
email_form:
AshPhoenix.Form.for_create(AshHq.MailingList.Email, :create,
upsert?: true,
upsert_identity: :unique_email
)
contributors: contributors
)}
end

Expand All @@ -503,21 +498,6 @@ defmodule AshHqWeb.Pages.Home do
end
end

def handle_event("validate_email_form", %{"form" => form}, socket) do
{:noreply,
assign(socket, email_form: AshPhoenix.Form.validate(socket.assigns.email_form, form))}
end

def handle_event("submit_email_form", _, socket) do
case AshPhoenix.Form.submit(socket.assigns.email_form) do
{:ok, _} ->
{:noreply, assign(socket, :signed_up, true)}

{:error, form} ->
{:noreply, assign(socket, email_form: form)}
end
end

@changeset_example """
post = Example.Post.create!(%{
text: "Declarative programming is fun!"
Expand Down

0 comments on commit d00ed5c

Please sign in to comment.