Fix trash: improve error handling and add logging for restore/perm delete denials

This commit is contained in:
dev
2026-09-09 23:28:02 +03:00
parent bc3487639d
commit 0f267ca6a9
2 changed files with 720 additions and 96 deletions
+1 -1
View File
@@ -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) {
+719 -95
View File
File diff suppressed because it is too large Load Diff