feat: wire validation accept -> PATCH order status=accepted (closes the 50/50 escrow loop in UI)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-24 19:05:43 +02:00
co-authored by Claude Opus 4.8
parent 318e9379c8
commit 9eb1ea6557
+12 -1
View File
@@ -36,6 +36,17 @@ export default function ValidationPage() {
const toggleDest = (d: string) => setDests((p) => (p.includes(d) ? p.filter((x) => x !== d) : [...p, d]));
async function approve() {
try {
await fetch(`/api/orders/${id}`, {
method: "PATCH",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ status: "accepted" }),
});
} catch {}
setApproved(true);
}
return (
<main ref={ref} className="min-h-screen bg-background text-foreground">
<OrderStepper active={4} />
@@ -248,7 +259,7 @@ export default function ValidationPage() {
Revidera
</button>
<button
onClick={() => setApproved(true)}
onClick={approve}
className="bg-foreground px-5 py-3 font-mono text-[12px] uppercase tracking-[0.1em] text-background transition-colors hover:bg-[var(--accent-red)]"
>
Godkänn · frigör 50 %