fix(intake): send application/json Content-Type on ReviewStep validate

The cold-visitor review-step path POSTed /validate with no Content-Type, so
the API returned 415 and validation silently failed — the user could create
the order but never advance from review to payment (the last blocker in the
trucking/HC checkout funnel). The Wizard's own validate call already set the
header; ReviewStep now matches. Completes the checkout repair in 5546c58.
This commit is contained in:
justin 2026-06-23 13:11:35 -05:00
parent 5546c58bf0
commit f773718e4d

View file

@ -108,10 +108,12 @@ const vertical = slugVertical(service_slug);
orderNumber = created.order_number; orderNumber = created.order_number;
(window as any).PWIntake.set({ ...state, order_number: orderNumber }); (window as any).PWIntake.set({ ...state, order_number: orderNumber });
} }
// Step 2: validate // Step 2: validate. The API requires an application/json Content-Type even
// for an empty body — without it the request 415s and validation silently
// fails, stranding the user on the review step (no advance to payment).
const vResp = await fetch( const vResp = await fetch(
`/api/v1/compliance-orders/${orderNumber}/validate`, `/api/v1/compliance-orders/${orderNumber}/validate`,
{ method: "POST" }, { method: "POST", headers: { "Content-Type": "application/json" }, body: "{}" },
); );
const data = await vResp.json(); const data = await vResp.json();
return { return {