更新:models/routes/services/templates/docs
This commit is contained in:
@@ -339,8 +339,13 @@ function editGoal(id) {
|
||||
}
|
||||
|
||||
async function deleteGoal(id) {
|
||||
if (!confirm('确定删除此目标?')) return;
|
||||
await fetch(`${API_BASE}/${id}`, {method: 'DELETE'});
|
||||
if (!confirm('确定删除此目标?此操作不可恢复。')) return;
|
||||
const resp = await fetch(`${API_BASE}/${id}`, {method: 'DELETE'});
|
||||
const data = await resp.json();
|
||||
if (!resp.ok) {
|
||||
alert('删除失败:' + data.error);
|
||||
return;
|
||||
}
|
||||
loadGoals();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user