commit remaining frontend updates

This commit is contained in:
lizhilun
2026-07-01 16:15:23 +08:00
parent e69930799c
commit 77cd66a854
6 changed files with 82 additions and 10 deletions
+2 -3
View File
@@ -135,9 +135,8 @@ async function saveEditRecord() {
if (time) body.created_at = new Date(time).toISOString();
try {
const res = await fetch(API + '/api/records/' + id, {
const res = await apiFetch(API + '/api/records/' + id, {
method: 'PUT',
headers: headers(),
body: JSON.stringify(body)
});
if (!res.ok) { showToast('保存失败'); return; }
@@ -152,7 +151,7 @@ async function deleteEditRecord() {
const id = document.getElementById('editId').value;
if (!confirm('确定删除这条记录?')) return;
try {
const res = await fetch(API + '/api/records/' + id, { method: 'DELETE', headers: headers() });
const res = await apiFetch(API + '/api/records/' + id, { method: 'DELETE' });
if (!res.ok) { showToast('删除失败'); return; }
showToast('已删除');
closeEditModal();