refactor: Use submit_form wrapper in all LiveView forms
- Replace AshPhoenix.Form.submit with submit_form/3 wrapper - Import current_actor and submit_form from LiveHelpers - Consistent actor handling in all form submissions
This commit is contained in:
parent
897677a782
commit
77ae5c4888
7 changed files with 22 additions and 13 deletions
|
|
@ -91,7 +91,9 @@ defmodule MvWeb.CustomFieldLive.FormComponent do
|
|||
|
||||
@impl true
|
||||
def handle_event("save", %{"custom_field" => custom_field_params}, socket) do
|
||||
case AshPhoenix.Form.submit(socket.assigns.form, params: custom_field_params) do
|
||||
actor = MvWeb.LiveHelpers.current_actor(socket)
|
||||
|
||||
case MvWeb.LiveHelpers.submit_form(socket.assigns.form, custom_field_params, actor) do
|
||||
{:ok, custom_field} ->
|
||||
action =
|
||||
case socket.assigns.form.source.type do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue