fix(dashboard): resolve button calls /resolve endpoint, not PATCH

PATCH /decisions/{id}/ is a blind field-setter with no decided_at logic.
POST /decisions/{id}/resolve is the correct endpoint — it auto-sets
decided_at and emits a decision_resolved progress event.

Fixes: resolved decisions showing last in the sorted list because
decided_at was never populated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 22:16:17 +01:00
parent 4393a501e6
commit 4a8942f310

View File

@@ -347,10 +347,10 @@ if (filtered.length === 0) {
placeholder: "Why is this resolved, and what was decided?",
confirmLabel: "Resolve",
onConfirm: async (rationale) => {
const res = await fetch(`${API}/decisions/${d.id}/`, {
method: "PATCH",
const res = await fetch(`${API}/decisions/${d.id}/resolve`, {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({status: "resolved", rationale, decided_by: "human"}),
body: JSON.stringify({rationale, decided_by: "human"}),
});
if (!res.ok) throw new Error(`API error ${res.status}`);
},