File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -73,22 +73,22 @@ export const useDAVFiles = function(
7373 } )
7474 }
7575
76- const getNodes = ( ) : CancelablePromise < Node [ ] > => {
76+ const getNodes = ( ) : CancelablePromise < ContentsWithRoot > => {
7777 const controller = new AbortController ( )
7878 return new CancelablePromise ( async ( resolve , reject , onCancel ) => {
7979 onCancel ( ( ) => controller . abort ( ) )
8080 try {
8181 const results = await client . value . getDirectoryContents ( `${ defaultRootPath } ${ currentPath . value } ` , {
8282 signal : controller . signal ,
8383 details : true ,
84+ includeSelf : true ,
8485 data : davGetDefaultPropfind ( ) ,
8586 } ) as ResponseDataDetailed < FileStat [ ] >
86- let nodes = results . data . map ( resultToNode )
87- // Hack for the public endpoint which always returns folder itself
88- if ( isPublicEndpoint ) {
89- nodes = nodes . filter ( ( file ) => file . path !== currentPath . value )
90- }
91- resolve ( nodes )
87+ const nodes = results . data . map ( resultToNode )
88+ resolve ( {
89+ folder : nodes . find ( ( file ) => file . path === currentPath . value ) as Folder ,
90+ contents : nodes . filter ( ( file ) => file . path !== currentPath . value ) ,
91+ } )
9292 } catch ( error ) {
9393 reject ( error )
9494 }
You can’t perform that action at this time.
0 commit comments