Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: encode uri for trashbin delete
Replace d280912 with a cleaner approach.

Signed-off-by: Daniel Kesselberg <[email protected]>
  • Loading branch information
kesselb committed Nov 13, 2023
commit b0f9113eba70a4c7e647e12d2c0998e98c67d88d
6 changes: 5 additions & 1 deletion apps/files/src/actions/deleteAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions dist/files-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-main.js.map

Large diffs are not rendered by default.