From 11876f12dc668ea1dc9a4f5455c2e2a47580c356 Mon Sep 17 00:00:00 2001 From: soryu Date: Thu, 22 Jan 2026 03:07:34 +0000 Subject: Fix board drag-and-drop phase change not working (#20) When phase_guard is enabled on a contract, the backend expects { phase, confirmed: true } to actually perform the phase change. Without confirmed: true, the backend returns a PhaseTransitionRequest instead of ContractSummary, causing the frontend to not update properly. Add confirmed parameter to changeContractPhase() with default true for backward compatibility and explicit user actions like drag-and-drop. Co-authored-by: Claude Opus 4.5 --- makima/frontend/src/lib/api.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/makima/frontend/src/lib/api.ts b/makima/frontend/src/lib/api.ts index efa72a2..aeaa218 100644 --- a/makima/frontend/src/lib/api.ts +++ b/makima/frontend/src/lib/api.ts @@ -1695,14 +1695,17 @@ export async function deleteContract(id: string): Promise { /** * Change contract phase. + * @param confirmed - When true, confirms the phase change even if phase_guard is enabled. + * Defaults to true for explicit user actions like drag-and-drop. */ export async function changeContractPhase( id: string, - phase: ContractPhase + phase: ContractPhase, + confirmed: boolean = true ): Promise { const res = await authFetch(`${API_BASE}/api/v1/contracts/${id}/phase`, { method: "POST", - body: JSON.stringify({ phase }), + body: JSON.stringify({ phase, confirmed }), }); if (!res.ok) { throw new Error(`Failed to change phase: ${res.statusText}`); -- cgit v1.2.3