summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-22 03:07:34 +0000
committerGitHub <noreply@github.com>2026-01-22 03:07:34 +0000
commit11876f12dc668ea1dc9a4f5455c2e2a47580c356 (patch)
tree291d16aa9efbf21293bb2cab2d70b2f28dafad2d
parentf7c08980d2a161a3739c71fddc5ca20871892365 (diff)
downloadsoryu-11876f12dc668ea1dc9a4f5455c2e2a47580c356.tar.gz
soryu-11876f12dc668ea1dc9a4f5455c2e2a47580c356.zip
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 <noreply@anthropic.com>
-rw-r--r--makima/frontend/src/lib/api.ts7
1 files 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<void> {
/**
* 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<ContractSummary> {
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}`);