mirror of
https://github.com/nextcloud/server.git
synced 2026-02-03 20:41:22 -05:00
fix: encode uri for trashbin delete
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
parent
e0adcc587e
commit
d280912f31
4 changed files with 7 additions and 5 deletions
|
|
@ -29,6 +29,7 @@ import History from '@mdi/svg/svg/history.svg?raw'
|
|||
|
||||
import { registerFileAction, FileAction } from '../../../files/src/services/FileAction.ts'
|
||||
import logger from '../../../files/src/logger.js'
|
||||
import { encodePath } from '@nextcloud/paths'
|
||||
|
||||
registerFileAction(new FileAction({
|
||||
id: 'restore',
|
||||
|
|
@ -51,7 +52,7 @@ registerFileAction(new FileAction({
|
|||
|
||||
async exec(node: Node) {
|
||||
try {
|
||||
const destination = generateRemoteUrl(encodeURI(`dav/trashbin/${getCurrentUser()?.uid}/restore/${node.basename}`))
|
||||
const destination = generateRemoteUrl(encodePath(`dav/trashbin/${getCurrentUser()?.uid}/restore/${node.basename}`))
|
||||
await axios({
|
||||
method: 'MOVE',
|
||||
url: node.source,
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import type { FileStat, ResponseDataDetailed } from 'webdav'
|
|||
import type { ContentsWithRoot } from '../../../files/src/services/Navigation.ts'
|
||||
|
||||
import client, { rootPath } from './client'
|
||||
import { encodePath } from '@nextcloud/paths'
|
||||
|
||||
const data = `<?xml version="1.0"?>
|
||||
<d:propfind xmlns:d="DAV:"
|
||||
|
|
@ -57,7 +58,7 @@ const resultToNode = function(node: FileStat): File | Folder {
|
|||
|
||||
const nodeData = {
|
||||
id: node.props?.fileid as number || 0,
|
||||
source: generateRemoteUrl('dav' + rootPath + node.filename),
|
||||
source: generateRemoteUrl(encodePath('dav' + rootPath + node.filename)),
|
||||
mtime: new Date(node.lastmod),
|
||||
mime: node.mime as string,
|
||||
size: node.props?.size as number || 0,
|
||||
|
|
|
|||
4
dist/files_trashbin-main.js
vendored
4
dist/files_trashbin-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files_trashbin-main.js.map
vendored
2
dist/files_trashbin-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue