mirror of
https://github.com/nextcloud/server.git
synced 2026-06-28 01:50:42 -04:00
Resolves: https://github.com/nextcloud/server/issues/46178 Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
18 lines
672 B
TypeScript
18 lines
672 B
TypeScript
/**
|
|
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
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<Node> => {
|
|
const propfindPayload = davGetDefaultPropfind()
|
|
const result = await client.stat(`${davRootPath}${node.path}`, {
|
|
details: true,
|
|
data: propfindPayload,
|
|
}) as ResponseDataDetailed<FileStat>
|
|
return davResultToNode(result.data)
|
|
}
|