From 3b7ef23774d4db150468d78d2bd31b87ade4d736 Mon Sep 17 00:00:00 2001 From: GouJ Date: Sat, 26 Sep 2026 20:05:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Breakdown=20=E5=89=8D=E7=AB=AF=E6=8E=A5?= =?UTF-8?q?=E6=94=B6=E5=90=8E=E5=8F=B0=E6=89=A7=E8=A1=8C=20ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/breakdown/api.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/features/breakdown/api.ts b/src/features/breakdown/api.ts index 40b4b8f..da30806 100644 --- a/src/features/breakdown/api.ts +++ b/src/features/breakdown/api.ts @@ -1,5 +1,6 @@ import { optionalResource, request } from '../../lib/http' import type { BreakdownAction, BreakdownInput, BreakdownPreview, BreakdownState } from './types' +import type { WorkflowExecutionStart } from '../workflows/execution.types' /** Breakdown API;预览为 GET,启动和恢复为等待完成的长 POST。 */ export const breakdownApi = { @@ -10,9 +11,14 @@ export const breakdownApi = { latest: (id: string, signal?: AbortSignal) => optionalResource(request(`/projects/${encodeURIComponent(id)}/breakdown/latest`, { signal })), run: (id: string, action: BreakdownAction, input?: BreakdownInput) => - request(`/projects/${encodeURIComponent(id)}/breakdown/${action}`, { - method: 'POST', - body: input, - timeoutMs: 0 - }) + action === 'start' + ? request(`/projects/${encodeURIComponent(id)}/breakdown/start`, { + method: 'POST', + body: input + }) + : request(`/projects/${encodeURIComponent(id)}/breakdown/${action}`, { + method: 'POST', + body: input, + timeoutMs: 0 + }) }