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