From 8e848ce435253531af01ec376c256e139dc42cfa Mon Sep 17 00:00:00 2001 From: soryu Date: Thu, 22 Jan 2026 01:29:17 +0000 Subject: Fix board drag-and-drop phase change not working 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 86ff06c..cf750fb 100644 --- a/makima/frontend/src/lib/api.ts +++ b/makima/frontend/src/lib/api.ts @@ -1672,14 +1672,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