Skip to content

Commit 0fca885

Browse files
authored
docs: fix handle event function in nested forms guide (#372)
Fixed handle_event errors in nested form documentation.
1 parent ac6bff1 commit 0fca885

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

documentation/topics/nested-forms.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,11 @@ defmodule MyApp.MyForm do
420420
{:ok, assign(socket, form: MyApp.Operations.form_to_create_business())}
421421
end
422422

423-
def handle_event(socket, "validate", %{"form" => params}) do
423+
def handle_event("validate", %{"form" => params}, socket) do
424424
{:noreply, assign(socket, :form, AshPhoenix.Form.validate(socket.assigns.form, params))}
425425
end
426426

427-
def handle_event(socket, "submit", %{"form" => params}) do
427+
def handle_event("submit", %{"form" => params}, socket) do
428428
case AshPhoenix.Form.submit(socket.assigns.form, params: params) do
429429
{:ok, business} ->
430430
socket =

0 commit comments

Comments
 (0)