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
|
|
@ -90,7 +90,9 @@ defmodule MvWeb.GlobalSettingsLive do
|
|||
|
||||
@impl true
|
||||
def handle_event("save", %{"setting" => setting_params}, socket) do
|
||||
case AshPhoenix.Form.submit(socket.assigns.form, params: setting_params) do
|
||||
actor = MvWeb.LiveHelpers.current_actor(socket)
|
||||
|
||||
case MvWeb.LiveHelpers.submit_form(socket.assigns.form, setting_params, actor) do
|
||||
{:ok, _updated_settings} ->
|
||||
# Reload settings from database to ensure all dependent data is updated
|
||||
{:ok, fresh_settings} = Membership.get_settings()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue