diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2023-10-28 16:26:42 +0200 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2023-11-13 14:49:32 +0100 |
commit | b0f9113eba70a4c7e647e12d2c0998e98c67d88d (patch) | |
tree | 0aa92e4d307d32f58bdcc6f83d2c21df7a52b120 /apps | |
parent | a61c609e9217befad24528e4c59cef92284ece49 (diff) | |
download | nextcloud-server-b0f9113eba70a4c7e647e12d2c0998e98c67d88d.tar.gz nextcloud-server-b0f9113eba70a4c7e647e12d2c0998e98c67d88d.zip |
fix: encode uri for trashbin delete
Replace d280912 with a cleaner approach.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/src/actions/deleteAction.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/files/src/actions/deleteAction.ts b/apps/files/src/actions/deleteAction.ts index a633e477b1f..d4cf607d0fc 100644 --- a/apps/files/src/actions/deleteAction.ts +++ b/apps/files/src/actions/deleteAction.ts @@ -28,6 +28,7 @@ import TrashCan from '@mdi/svg/svg/trash-can.svg?raw' import { registerFileAction, FileAction } from '../services/FileAction.ts' import logger from '../logger.js' import type { Navigation } from '../services/Navigation.ts' +import { encodePath } from '@nextcloud/paths'; registerFileAction(new FileAction({ id: 'delete', @@ -45,8 +46,11 @@ registerFileAction(new FileAction({ }, async exec(node: Node) { + const { origin } = new URL(node.source) + const encodedSource = origin + encodePath(node.source.slice(origin.length)) + try { - await axios.delete(node.source) + await axios.delete(encodedSource) // Let's delete even if it's moved to the trashbin // since it has been removed from the current view |