From dcf181d6404f5bd222c93860e8b9bd71f3a2e3cf Mon Sep 17 00:00:00 2001 From: MangoPig Date: Wed, 24 Jun 2026 17:24:59 +0100 Subject: [PATCH] Fix: preserve folder label casing --- Backend/internal/bootstrap/service.go | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Backend/internal/bootstrap/service.go b/Backend/internal/bootstrap/service.go index 8b471d4..7c853f0 100644 --- a/Backend/internal/bootstrap/service.go +++ b/Backend/internal/bootstrap/service.go @@ -885,13 +885,19 @@ func (service *Service) getProjectHierarchyFoldersByRootPath( rootParentPath := rootPath(project.Slug) rows, err := service.db.Pool.Query(ctx, ` - SELECT path, COALESCE(parent_path, ''), COALESCE(resource_name, '') - FROM posix_nodes - WHERE node_kind = 'directory'::posix_node_kind - AND logical_type = 'hierarchy_folder' - AND project_slug = $1 - AND path LIKE $2 - ORDER BY depth ASC, path ASC; + SELECT + directories.path, + COALESCE(directories.parent_path, ''), + COALESCE(folder_meta.resource_name, directories.resource_name, '') + FROM posix_nodes AS directories + LEFT JOIN posix_nodes AS folder_meta + 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+"/%") if err != nil { return nil, err