Skip to content

Commit e43f3f8

Browse files
StCyrsusnux
authored andcommitted
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 <[email protected]>
1 parent 2a6d7ea commit e43f3f8

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

developer_manual/client_apis/files.rst

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ the ``event-bus`` and use the following events:
3030
* ``files:node:moved``: the node has been moved (and its data is already updated)
3131
* ``files:node:updated``: the node data has been updated
3232

33-
All these events use a Node as argument.
33+
All these events use a Node as argument. You can use a webdav client (for example, by using the davGetClient function from `@nextcloud/files <https://nextcloud-libraries.github.io/nextcloud-files/>`__) to retrieve a node from a file's name.
3434

3535
Examples
3636
-------
@@ -44,21 +44,6 @@ Examples
4444
console.log('Node created', node)
4545
})
4646
47-
.. code-block:: ts
48-
49-
import { davGetClient, davGetDefaultPropfind, davResultToNode, davRootPath } from '@nextcloud/files'
50-
import { emit } from '@nextcloud/event-bus'
51-
52-
const client = davGetClient()
53-
client.stat(`${davRootPath}${filename}`, {
54-
details: true,
55-
data: davGetDefaultPropfind(),
56-
}).then((result) => {
57-
const node = davResultToNode(result.data)
58-
emit('files:node:updated', node)
59-
})
60-
61-
6247
Router
6348
^^^^^^
6449

0 commit comments

Comments
 (0)