summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-22 01:29:17 +0000
committersoryu <soryu@soryu.co>2026-01-22 01:32:58 +0000
commit8e848ce435253531af01ec376c256e139dc42cfa (patch)
tree2ff81beca4ed4ca3e6af744158c1f54a6e90fc50
parent9e286c146e29e714b3b209b4d948d75cce179b05 (diff)
downloadsoryu-8e848ce435253531af01ec376c256e139dc42cfa.tar.gz
soryu-8e848ce435253531af01ec376c256e139dc42cfa.zip
Fix board drag-and-drop phase change not workingmakima/fix-board-drag-drop
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 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<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}`);