Fix trash: improve error handling and add logging for restore/perm delete denials
This commit is contained in:
+1
-1
@@ -61,7 +61,7 @@ function goPage(p) { page = p; loadTrash(); }
|
|||||||
async function restoreEntry(id) {
|
async function restoreEntry(id) {
|
||||||
const res = await fetch(`${API}/api/entries/${id}/restore`, { method: 'PUT', headers: hdr() });
|
const res = await fetch(`${API}/api/entries/${id}/restore`, { method: 'PUT', headers: hdr() });
|
||||||
if (res.ok) { showToast('Запись восстановлена'); loadTrash(); }
|
if (res.ok) { showToast('Запись восстановлена'); loadTrash(); }
|
||||||
else { const err = await res.json(); alert(err.error || 'Ошибка'); }
|
else { const err = await res.json(); showToast(err.error || 'Ошибка восстановления'); }
|
||||||
}
|
}
|
||||||
|
|
||||||
async function hardDelete(id) {
|
async function hardDelete(id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user