All checks were successful
deploy / deploy (push) Successful in 1m17s
Magic link flow on contact page: customer enters email, gets a time-limited signed link, clicks through to /orders showing all their paid orders and full detail pages with thumbnails and product links. - OrderLookupController generates/verifies Phoenix.Token signed links - Contact LiveView handles lookup_orders + reset_tracking events - Orders and OrderDetail LiveViews gated by session email - Order detail shows thumbnails, links to products still available - .themed-button gets base padding/font-weight so all usages are consistent - order-summary-card sticky scoped to .cart-grid (was leaking to orders list) - 27 new tests (1095 total) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
35 lines
680 B
Elixir
35 lines
680 B
Elixir
defmodule BerrypodWeb.Shop.Orders do
|
|
use BerrypodWeb, :live_view
|
|
|
|
alias Berrypod.Orders
|
|
|
|
@impl true
|
|
def mount(_params, session, socket) do
|
|
email = session["order_lookup_email"]
|
|
|
|
socket =
|
|
socket
|
|
|> assign(:page_title, "Your orders")
|
|
|> assign(:lookup_email, email)
|
|
|
|
socket =
|
|
if email do
|
|
assign(socket, :orders, Orders.list_orders_by_email(email))
|
|
else
|
|
assign(socket, :orders, nil)
|
|
end
|
|
|
|
{:ok, socket}
|
|
end
|
|
|
|
@impl true
|
|
def handle_params(_params, _uri, socket), do: {:noreply, socket}
|
|
|
|
@impl true
|
|
def render(assigns) do
|
|
~H"""
|
|
<BerrypodWeb.PageTemplates.orders {assigns} />
|
|
"""
|
|
end
|
|
end
|