feat(vereinfacht): member form flash and show page
- Form: show Vereinfacht sync warning after save via SyncFlash - Show: load API debug response; MembershipFees: contact ID, link, no-contact warning
This commit is contained in:
parent
81bcd2bc4d
commit
d0fa3991f7
3 changed files with 117 additions and 2 deletions
|
|
@ -256,6 +256,7 @@ defmodule MvWeb.MemberLive.Show do
|
|||
id={"membership-fees-#{@member.id}"}
|
||||
member={@member}
|
||||
current_user={@current_user}
|
||||
vereinfacht_debug_response={@vereinfacht_debug_response}
|
||||
/>
|
||||
<% end %>
|
||||
</Layouts.app>
|
||||
|
|
@ -264,7 +265,10 @@ defmodule MvWeb.MemberLive.Show do
|
|||
|
||||
@impl true
|
||||
def mount(_params, _session, socket) do
|
||||
{:ok, assign(socket, :active_tab, :contact)}
|
||||
{:ok,
|
||||
socket
|
||||
|> assign(:active_tab, :contact)
|
||||
|> assign(:vereinfacht_debug_response, nil)}
|
||||
end
|
||||
|
||||
@impl true
|
||||
|
|
@ -316,6 +320,16 @@ defmodule MvWeb.MemberLive.Show do
|
|||
{:noreply, assign(socket, :active_tab, :membership_fees)}
|
||||
end
|
||||
|
||||
def handle_event("load_vereinfacht_debug", %{"contact_id" => contact_id}, socket) do
|
||||
response =
|
||||
case Mv.Vereinfacht.Client.get_contact(contact_id) do
|
||||
{:ok, body} -> {:ok, body}
|
||||
{:error, reason} -> {:error, reason}
|
||||
end
|
||||
|
||||
{:noreply, assign(socket, :vereinfacht_debug_response, response)}
|
||||
end
|
||||
|
||||
# Flash set in LiveComponent is not shown in parent layout; child sends this to display flash
|
||||
@impl true
|
||||
def handle_info({:put_flash, type, message}, socket) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue