From e43f3f816e798254a17a4ea5d7365bd4466ee8b0 Mon Sep 17 00:00:00 2001 From: Cyrille Bollu Date: Fri, 5 Jul 2024 09:44:42 +0200 Subject: [PATCH] Removes example how to emit files:node:* events rather mention the davClient from @nextcloud/files to get a Node from a filename Signed-off-by: Cyrille Bollu --- developer_manual/client_apis/files.rst | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/developer_manual/client_apis/files.rst b/developer_manual/client_apis/files.rst index 9d42585bf..2100dc2a3 100644 --- a/developer_manual/client_apis/files.rst +++ b/developer_manual/client_apis/files.rst @@ -30,7 +30,7 @@ the ``event-bus`` and use the following events: * ``files:node:moved``: the node has been moved (and its data is already updated) * ``files:node:updated``: the node data has been updated -All these events use a Node as argument. +All these events use a Node as argument. You can use a webdav client (for example, by using the davGetClient function from `@nextcloud/files `__) to retrieve a node from a file's name. Examples ------- @@ -44,21 +44,6 @@ Examples console.log('Node created', node) }) -.. code-block:: ts - - import { davGetClient, davGetDefaultPropfind, davResultToNode, davRootPath } from '@nextcloud/files' - import { emit } from '@nextcloud/event-bus' - - const client = davGetClient() - client.stat(`${davRootPath}${filename}`, { - details: true, - data: davGetDefaultPropfind(), - }).then((result) => { - const node = davResultToNode(result.data) - emit('files:node:updated', node) - }) - - Router ^^^^^^