From 571e06a35c2b26122979d6862914e21967e006fb Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Thu, 22 Feb 2024 10:06:52 +0100 Subject: chore(files): replace `encodeFilePath` by `encodePath` from `@nextcloud/paths` Signed-off-by: skjnldsv --- apps/files_versions/src/utils/versions.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'apps/files_versions/src') diff --git a/apps/files_versions/src/utils/versions.ts b/apps/files_versions/src/utils/versions.ts index b33f75aefa7..e3555339b27 100644 --- a/apps/files_versions/src/utils/versions.ts +++ b/apps/files_versions/src/utils/versions.ts @@ -21,18 +21,16 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ +import type { FileStat, ResponseDataDetailed } from 'webdav' -import { getCurrentUser } from '@nextcloud/auth' -import { joinPaths } from '@nextcloud/paths' import { generateRemoteUrl, generateUrl } from '@nextcloud/router' +import { getCurrentUser } from '@nextcloud/auth' +import { joinPaths, encodePath } from '@nextcloud/paths' import moment from '@nextcloud/moment' -import { encodeFilePath } from '../../../files/src/utils/fileUtils.ts' - import client from '../utils/davClient.js' import davRequest from '../utils/davRequest.js' import logger from '../utils/logger.js' -import type { FileStat, ResponseDataDetailed } from 'webdav' export interface Version { fileId: string, // The id of the file associated to the version. @@ -120,7 +118,7 @@ function formatVersion(version: any, fileInfo: any): Version { hasPreview: version.props['has-preview'] === 1, previewUrl, url: joinPaths('/remote.php/dav', version.filename), - source: generateRemoteUrl('dav') + encodeFilePath(version.filename), + source: generateRemoteUrl('dav') + encodePath(version.filename), fileVersion: version.basename, } } -- cgit v1.2.3