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'); }