feat(drive): permanent deletion per drive

This commit is contained in:
Edouard Vanbelle
2026-06-24 21:31:59 +02:00
parent 7d24015fc4
commit b73f176024
10 changed files with 596 additions and 23 deletions
+16
View File
@@ -111,3 +111,19 @@ export async function emptyTrash(): Promise<void> {
});
if (!res.ok) throw new Error(`empty trash failed: ${res.status}`);
}
/**
* `DELETE /api/trash/drive/{drive_id}` — empty the trash within a
* single drive. Used by the trash page's Drive group-by, where each
* bucket header carries a per-drive Empty button so multi-drive
* owners don't have to wipe everything at once. Refused 404 when the
* caller lacks Delete on the named drive (anti-enum).
*/
export async function emptyTrashForDrive(driveId: string): Promise<void> {
const res = await apiFetch(`/api/trash/drive/${encodeURIComponent(driveId)}`, {
method: 'DELETE',
credentials: 'same-origin',
headers: getCsrfHeaders()
});
if (!res.ok) throw new Error(`empty drive trash failed: ${res.status}`);
}