From a561a190b80ebc64f393e50d25eec746300503e1 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Tue, 19 May 2026 13:58:15 +0800 Subject: [PATCH] auto-sync: 2026-05-19 13:58:15 --- .../src/components/CheckpointPanel.tsx | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/frontend/src/components/CheckpointPanel.tsx b/src/frontend/src/components/CheckpointPanel.tsx index 637526f..8f04f00 100644 --- a/src/frontend/src/components/CheckpointPanel.tsx +++ b/src/frontend/src/components/CheckpointPanel.tsx @@ -113,15 +113,9 @@ function DecisionCheckpoint({ // ── Verify Checkpoint ── function VerifyCheckpoint({ - taskId, - info, - onDone, -}: { - taskId: string; - info: CheckpointInfo; - onDone: () => void; -}) { - const cp = info.checkpoint; + taskId, cp, onDone, +}: { taskId: string; cp: Checkpoint; onDone: () => void }) { + const payload: VerifyPayload = JSON.parse(cp.payload || '{}'); const [reason, setReason] = useState(''); const [showReject, setShowReject] = useState(false); const [loading, setLoading] = useState(false); @@ -131,11 +125,11 @@ function VerifyCheckpoint({ if (action === 'reject' && !showReject) { setShowReject(true); return; } setLoading(true); try { - const r = await api.humanInputRespond(taskId, { - node_id: info.node_id, - action, - reason, + const res = await fetch(`/api/projects/${api._getProjectId()}/tasks/${taskId}/checkpoints/${cp.id}/${action}`, { + method: 'POST', headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ resolved_by: 'user', note: reason }), }); + const r = await res.json(); if (r.ok) { toast(action === 'approve' ? '✅ 已御批' : '❌ 已驳回', 'ok'); onDone(); } else toast(r.error || '操作失败', 'err'); } catch { toast('服务器连接失败', 'err'); }