mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
fix: encode uri for trashbin delete
Replace d280912 with a cleaner approach.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
parent
a61c609e92
commit
b0f9113eba
3 changed files with 8 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
4
dist/files-main.js
vendored
4
dist/files-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-main.js.map
vendored
2
dist/files-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue