add no-JS fallback for provider forms
Progressive enhancement: provider form now works without JavaScript. Forms POST to ProvidersController (create/update), which handles validation and redirects with flash messages. With JS: LiveView phx-submit handles save, navigates with flash. Without JS: Form POSTs to controller, redirects with flash. Completes Task 3 of notification overhaul (admin forms migration). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -27,7 +27,18 @@
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<.form for={@form} id="provider-form" phx-change="validate" phx-submit="save">
|
||||
<.form
|
||||
for={@form}
|
||||
id="provider-form"
|
||||
action={
|
||||
if @live_action == :new,
|
||||
do: ~p"/admin/providers",
|
||||
else: ~p"/admin/providers/#{@connection.id}"
|
||||
}
|
||||
method="post"
|
||||
phx-change="validate"
|
||||
phx-submit="save"
|
||||
>
|
||||
<input type="hidden" name="provider_connection[provider_type]" value={@provider_type} />
|
||||
|
||||
<.input
|
||||
|
||||
Reference in New Issue
Block a user