aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/yaml_util.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-14 04:26:34 -0400
committerhistoria <[not public]>2026-07-14 04:26:34 -0400
commitb5491f140ebf1099171c932b688303e05d01a06c (patch)
tree2b688ffb4e75a37dbec97796fd1598f56b1ad977 /internal/admin/yaml_util.go
parent430c81bd2056769e1326df9d1dff983afe7f33df (diff)
downloadthehouseoficarus-b5491f140ebf1099171c932b688303e05d01a06c.tar.gz
feat(admin): hide unused mod fields
Diffstat (limited to 'internal/admin/yaml_util.go')
-rw-r--r--internal/admin/yaml_util.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/admin/yaml_util.go b/internal/admin/yaml_util.go
index b869ffe..2d838ad 100644
--- a/internal/admin/yaml_util.go
+++ b/internal/admin/yaml_util.go
@@ -34,6 +34,10 @@ func writeYAMLFile(path string, data any) ([]byte, error) {
func findYAMLFileInSubdirs(dataDir, subdir, id string) ([]byte, string, error) {
base := filepath.Join(dataDir, subdir)
+ rootPath := filepath.Join(base, id+".yaml")
+ if data, err := os.ReadFile(rootPath); err == nil {
+ return data, rootPath, nil
+ }
entries, err := os.ReadDir(base)
if err != nil {
return nil, "", err