auto-sync: 2026-05-20 22:15:54

This commit is contained in:
cfdaily
2026-05-20 22:15:54 +08:00
parent 035e8397b3
commit 2730df4195
+7 -1
View File
@@ -346,9 +346,15 @@ export default function EdictBoard() {
if (!showProjectConfirm) return;
const { id, action } = showProjectConfirm;
try {
const res = await fetch(`/api/projects/${id}/${action === 'archive' ? 'archive' : ''}`, {
const res = await fetch(`/api/projects/${id}`, {
method: action === 'archive' ? 'POST' : 'DELETE',
...(action === 'archive' ? {} : {}),
});
if (action === 'archive') {
// archive 走专用端点
const res2 = await fetch(`/api/projects/${id}/archive`, { method: 'POST' });
if (!res2.ok) { toast('归档失败', 'err'); return; }
}
if (res.ok) {
toast(action === 'archive' ? `📦 已归档 ${id}` : `🗑️ 已删除 ${id}`);
setSelectedProjectId('');