diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-06-10 21:20:31 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-06-11 15:45:21 +0200 |
commit | 9ea557e34a0cfba79fd32296869e696c1812fcc5 (patch) | |
tree | de1b1f96d613059707734a3fa63c0529973c7e15 /apps | |
parent | 2a2e8c860928086b2374d8c515ce738e4774be42 (diff) | |
download | nextcloud-server-9ea557e34a0cfba79fd32296869e696c1812fcc5.tar.gz nextcloud-server-9ea557e34a0cfba79fd32296869e696c1812fcc5.zip |
refactor(systemtags): Do not link to files app but directly use functions from `@nextcloud/files`
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/systemtags/src/services/systemtags.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/systemtags/src/services/systemtags.ts b/apps/systemtags/src/services/systemtags.ts index c587c594db7..8e318f13adc 100644 --- a/apps/systemtags/src/services/systemtags.ts +++ b/apps/systemtags/src/services/systemtags.ts @@ -2,16 +2,18 @@ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ +import type { ContentsWithRoot } from '@nextcloud/files' import type { FileStat, ResponseDataDetailed } from 'webdav' import type { TagWithId } from '../types' -import { Folder, type ContentsWithRoot, Permission, getDavNameSpaces, getDavProperties } from '@nextcloud/files' +import { Folder, Permission, getDavNameSpaces, getDavProperties, davGetClient, davResultToNode } from '@nextcloud/files' import { generateRemoteUrl } from '@nextcloud/router' import { getCurrentUser } from '@nextcloud/auth' import { fetchTags } from './api' -import { getClient } from '../../../files/src/services/WebdavClient' -import { resultToNode } from '../../../files/src/services/Files' + +const client = davGetClient() +const resultToNode = (node: FileStat) => davResultToNode(node) const formatReportPayload = (tagId: number) => `<?xml version="1.0"?> <oc:filter-files ${getDavNameSpaces()}> @@ -62,7 +64,7 @@ export const getContents = async (path = '/'): Promise<ContentsWithRoot> => { } const folder = tagToNode(tag) - const contentsResponse = await getClient().getDirectoryContents('/', { + const contentsResponse = await client.getDirectoryContents('/', { details: true, // Only filter favorites if we're at the root data: formatReportPayload(tagId), |