Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dcf181d640 |
@@ -885,13 +885,19 @@ func (service *Service) getProjectHierarchyFoldersByRootPath(
|
|||||||
rootParentPath := rootPath(project.Slug)
|
rootParentPath := rootPath(project.Slug)
|
||||||
|
|
||||||
rows, err := service.db.Pool.Query(ctx, `
|
rows, err := service.db.Pool.Query(ctx, `
|
||||||
SELECT path, COALESCE(parent_path, ''), COALESCE(resource_name, '')
|
SELECT
|
||||||
FROM posix_nodes
|
directories.path,
|
||||||
WHERE node_kind = 'directory'::posix_node_kind
|
COALESCE(directories.parent_path, ''),
|
||||||
AND logical_type = 'hierarchy_folder'
|
COALESCE(folder_meta.resource_name, directories.resource_name, '')
|
||||||
AND project_slug = $1
|
FROM posix_nodes AS directories
|
||||||
AND path LIKE $2
|
LEFT JOIN posix_nodes AS folder_meta
|
||||||
ORDER BY depth ASC, path ASC;
|
ON folder_meta.path = directories.path || '/folder.json'
|
||||||
|
AND folder_meta.node_kind = 'file'::posix_node_kind
|
||||||
|
WHERE directories.node_kind = 'directory'::posix_node_kind
|
||||||
|
AND directories.logical_type = 'hierarchy_folder'
|
||||||
|
AND directories.project_slug = $1
|
||||||
|
AND directories.path LIKE $2
|
||||||
|
ORDER BY directories.depth ASC, directories.path ASC;
|
||||||
`, project.Slug, rootParentPath+"/%")
|
`, project.Slug, rootParentPath+"/%")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user