Skip to content

Commit 39ffea0

Browse files
committed
chore(docs): update last readme example syntax
Imports now come from `@nextcloud/files/dav`. Signed-off-by: Max <max@nextcloud.com>
1 parent 6979967 commit 39ffea0

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,20 @@ const nodes = results.data.map((result) => resultToNode(r, myRoot, myRemoteURL))
100100
#### Using WebDAV to get a Node from a file's name
101101

102102
```ts
103-
import { getClient, davGetDefaultPropfind, resultToNode, davRootPath } from '@nextcloud/files'
104-
import { emit } from '@nextcloud/event-bus'
105-
const client = getClient()
106-
client.stat(`${davRootPath}${filename}`, {
107-
details: true,
108-
data: davGetDefaultPropfind(),
109-
}).then((result) => {
110-
const node = resultToNode(result.data)
111-
emit('files:node:updated', node)
112-
})
103+
import {
104+
getClient,
105+
getDefaultPropfind,
106+
resultToNode,
107+
defaultRootPath,
108+
} from '@nextcloud/files/dav'
109+
import { emit } from '@nextcloud/event-bus'
110+
111+
const client = getClient()
112+
client.stat(`${defaultRootPath}${filename}`, {
113+
details: true,
114+
data: getDefaultPropfind(),
115+
}).then((result) => {
116+
const node = resultToNode(result.data)
117+
emit('files:node:updated', node)
118+
})
113119
```

0 commit comments

Comments
 (0)