auto-sync: 2026-05-21 15:32:56
This commit is contained in:
@@ -162,9 +162,14 @@ function StatusButtons({ status, taskId, onAction }: { status: string; taskId: s
|
||||
});
|
||||
if (res.ok) { toast('📦 已归档'); loadV2Tasks(); } else toast('归档失败', 'err');
|
||||
} else {
|
||||
const result = await api.taskStatusUpdate(taskId, targetStatus);
|
||||
const pid = selectedProjectId || '';
|
||||
const res = await fetch(`/api/projects/${pid}/tasks/${taskId}/status`, {
|
||||
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ status: targetStatus }),
|
||||
});
|
||||
const result = await res.json();
|
||||
if (result.ok) { toast(`${targetStatus} 操作成功`, 'ok'); loadV2TaskDetail(taskId); loadAll(); onAction?.(); }
|
||||
else toast(result.error || '操作失败', 'err');
|
||||
else toast(result.detail?.detail || result.error || '操作失败', 'err');
|
||||
}
|
||||
} catch (e: any) {
|
||||
toast(e.message || '⚠️ 操作失败', 'err');
|
||||
|
||||
Reference in New Issue
Block a user