auto-sync: 2026-05-19 13:58:15

This commit is contained in:
cfdaily
2026-05-19 13:58:15 +08:00
parent fad494c4ea
commit a561a190b8
@@ -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'); }