commit remaining frontend updates
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user