auto-sync: 2026-05-20 22:16:03

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