deduplication of trash code

This commit is contained in:
2025-06-04 11:16:43 +02:00
parent 6ae1ee3365
commit 79fa32d1dd
2 changed files with 6 additions and 55 deletions

View File

@@ -51,7 +51,7 @@ window.emptyTrash = function() {
}
// Get all trashed files to get their room IDs
fetch('/api/rooms/trash')
fetch('/api/trash')
.then(r => r.json())
.then(files => {
if (!files || !files.length) {
@@ -97,7 +97,9 @@ window.emptyTrash = function() {
document.querySelector('.modal-backdrop')?.remove();
document.body.classList.remove('modal-open');
// Refresh the view to ensure everything is up to date
fetchFiles();
if (typeof window.fetchFiles === 'function') {
window.fetchFiles();
}
} else {
console.error('Failed to empty trash in some rooms');
// Show error message to user