From 3dc897518e254d2683f43419e84b05b26f6b910a Mon Sep 17 00:00:00 2001 From: Kobe Date: Wed, 4 Jun 2025 11:24:28 +0200 Subject: [PATCH] Update trash.js --- static/js/trash.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/static/js/trash.js b/static/js/trash.js index 04aaca3..c129585 100644 --- a/static/js/trash.js +++ b/static/js/trash.js @@ -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: '' + }) }) );