Skip to content

Commit 06e2199

Browse files
authored
Merge pull request #1533 from nextcloud-libraries/fix/readme-example
chore(docs): update last readme example syntax
2 parents f1c7276 + eb262c2 commit 06e2199

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
@@ -226,14 +226,20 @@ const nodes = results.data.map((result) => resultToNode(r, myRoot, myRemoteURL))
226226
#### Using WebDAV to get a Node from a file's name
227227

228228
```ts
229-
import { getClient, davGetDefaultPropfind, resultToNode, davRootPath } from '@nextcloud/files'
230-
import { emit } from '@nextcloud/event-bus'
231-
const client = getClient()
232-
client.stat(`${davRootPath}${filename}`, {
233-
details: true,
234-
data: davGetDefaultPropfind(),
235-
}).then((result) => {
236-
const node = resultToNode(result.data)
237-
emit('files:node:updated', node)
238-
})
229+
import {
230+
getClient,
231+
getDefaultPropfind,
232+
resultToNode,
233+
defaultRootPath,
234+
} from '@nextcloud/files/dav'
235+
import { emit } from '@nextcloud/event-bus'
236+
237+
const client = getClient()
238+
client.stat(`${defaultRootPath}${filename}`, {
239+
details: true,
240+
data: getDefaultPropfind(),
241+
}).then((result) => {
242+
const node = resultToNode(result.data)
243+
emit('files:node:updated', node)
244+
})
239245
```

0 commit comments

Comments
 (0)