Load initial paths for file browser

This commit is contained in:
Bogdan 2026-03-21 12:33:27 +02:00 committed by Mark McDowall
parent be4a564456
commit 9a0e23a93f
3 changed files with 6 additions and 3 deletions

View file

@ -133,7 +133,11 @@ function FileBrowserModalContent({
className={styles.scroller}
scrollDirection="both"
>
{error ? <div>{translate('ErrorLoadingContents')}</div> : null}
{error ? (
<Alert kind={kinds.DANGER}>
{translate('ErrorLoadingContents')}
</Alert>
) : null}
{isFetched && !error ? (
<Table horizontalScroll={false} columns={columns}>

View file

@ -47,7 +47,6 @@ const usePaths = ({
path: '/filesystem',
queryParams: { path, allowFoldersWithoutTrailingSlashes, includeFiles },
queryOptions: {
enabled: path.trim().length > 0,
placeholderData: keepPreviousData,
},
});

View file

@ -24,7 +24,7 @@ public FileSystemController(IFileSystemLookupService fileSystemLookupService,
[HttpGet]
[Produces("application/json")]
public IActionResult GetContents(string path, bool includeFiles = false, bool allowFoldersWithoutTrailingSlashes = false)
public IActionResult GetContents(string? path, bool includeFiles = false, bool allowFoldersWithoutTrailingSlashes = false)
{
return Ok(_fileSystemLookupService.LookupContents(path, includeFiles, allowFoldersWithoutTrailingSlashes));
}