fix: update clubname on save
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e0712d47bc
commit
dd4048669c
5 changed files with 28 additions and 11 deletions
|
|
@ -37,7 +37,7 @@ defmodule MvWeb.GlobalSettingsLive do
|
|||
@impl true
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<Layouts.app flash={@flash} current_user={@current_user}>
|
||||
<Layouts.app flash={@flash} current_user={@current_user} club_name={@settings.club_name}>
|
||||
<.header>
|
||||
{gettext("Settings")}
|
||||
<:subtitle>
|
||||
|
|
@ -80,10 +80,13 @@ 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
|
||||
{:ok, updated_settings} ->
|
||||
{:ok, _updated_settings} ->
|
||||
# Reload settings from database to ensure all dependent data is updated
|
||||
{:ok, fresh_settings} = Membership.get_settings()
|
||||
|
||||
socket =
|
||||
socket
|
||||
|> assign(:settings, updated_settings)
|
||||
|> assign(:settings, fresh_settings)
|
||||
|> put_flash(:info, gettext("Settings updated successfully"))
|
||||
|> assign_form()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue