deduplication of trash code
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user