diff --git a/apps/files/src/services/WebdavClient.ts b/apps/files/src/services/WebdavClient.ts index 5563508e2c7bc..cd33147b03f09 100644 --- a/apps/files/src/services/WebdavClient.ts +++ b/apps/files/src/services/WebdavClient.ts @@ -2,6 +2,17 @@ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ -import { davGetClient } from '@nextcloud/files' +import { davGetClient, davGetDefaultPropfind, davResultToNode, davRootPath } from '@nextcloud/files' +import type { FileStat, ResponseDataDetailed } from 'webdav' +import type { Node } from '@nextcloud/files' export const client = davGetClient() + +export const fetchNode = async (node: Node): Promise => { + const propfindPayload = davGetDefaultPropfind() + const result = await client.stat(`${davRootPath}${node.path}`, { + details: true, + data: propfindPayload, + }) as ResponseDataDetailed + return davResultToNode(result.data) +} diff --git a/apps/files/src/views/Sidebar.vue b/apps/files/src/views/Sidebar.vue index 5d9f2079253c6..04b7a1cfe7a60 100644 --- a/apps/files/src/views/Sidebar.vue +++ b/apps/files/src/views/Sidebar.vue @@ -17,14 +17,20 @@ @closing="handleClosing" @closed="handleClosed"> -