Update trash.js

This commit is contained in:
2025-06-04 11:24:28 +02:00
parent 79fa32d1dd
commit 3dc897518e

View File

@@ -51,7 +51,7 @@ window.emptyTrash = function() {
} }
// Get all trashed files to get their room IDs // Get all trashed files to get their room IDs
fetch('/api/trash') fetch('/api/rooms/trash')
.then(r => r.json()) .then(r => r.json())
.then(files => { .then(files => {
if (!files || !files.length) { if (!files || !files.length) {
@@ -69,12 +69,16 @@ window.emptyTrash = function() {
// Create an array of promises for emptying trash in each room // Create an array of promises for emptying trash in each room
const emptyPromises = roomIds.map(roomId => const emptyPromises = roomIds.map(roomId =>
fetch(`/api/trash/${roomId}/trash/empty`, { fetch(`/api/rooms/${roomId}/delete-permanent`, {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'X-CSRF-Token': csrfToken 'X-CSRF-Token': csrfToken
} },
body: JSON.stringify({
filename: '*', // Delete all files in the room
path: ''
})
}) })
); );