add no-JS fallback for contact page order tracking form
Some checks failed
deploy / deploy (push) Has been cancelled

Both order tracking forms now have action="/contact/lookup" so they
POST to a new OrderLookupController.lookup action when JS is off.
The controller mirrors the LiveView handler: checks for paid orders,
sends the verification email, and redirects with a flash message.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-02-24 23:10:15 +00:00
parent 6ee8a31716
commit 6289c678f7
4 changed files with 80 additions and 2 deletions

View File

@@ -167,7 +167,8 @@ defmodule BerrypodWeb.ShopComponents.Content do
<p class="card-text card-text--spaced">
No orders found for that address. Make sure you use the same email you checked out with.
</p>
<form phx-submit="lookup_orders" class="card-inline-form">
<form action="/contact/lookup" method="post" phx-submit="lookup_orders" class="card-inline-form">
<input type="hidden" name="_csrf_token" value={Phoenix.Controller.get_csrf_token()} />
<.shop_input
type="email"
name="email"
@@ -188,7 +189,8 @@ defmodule BerrypodWeb.ShopComponents.Content do
<p class="card-text card-text--spaced">
Enter the email address you used at checkout and we'll send you a link.
</p>
<form phx-submit="lookup_orders" class="card-inline-form">
<form action="/contact/lookup" method="post" phx-submit="lookup_orders" class="card-inline-form">
<input type="hidden" name="_csrf_token" value={Phoenix.Controller.get_csrf_token()} />
<.shop_input
type="email"
name="email"