diff --git a/internal/cac/storage/multi.go b/internal/cac/storage/multi.go index b8e4a5d..8888c62 100644 --- a/internal/cac/storage/multi.go +++ b/internal/cac/storage/multi.go @@ -3,6 +3,7 @@ package storage import ( "context" "fmt" + "github.com/cloudentity/acp-client-go/clients/hub/models" "github.com/cloudentity/cac/internal/cac/api" "github.com/imdario/mergo" diff --git a/internal/cac/storage/tenant_storage.go b/internal/cac/storage/tenant_storage.go index 321c49d..b2ba635 100644 --- a/internal/cac/storage/tenant_storage.go +++ b/internal/cac/storage/tenant_storage.go @@ -144,7 +144,7 @@ func (t *TenantStorage) Read(ctx context.Context, opts ...api.SourceOpt) (models templatesConfig map[string]any ) - if templatesConfig, err = readFiles(filepath.Join(path, "themes", normalize(theme.Name), "templates")); err != nil { + if templatesConfig, err = readFiles(filepath.Join(path, "themes", dir, "templates")); err != nil { return nil, err } diff --git a/internal/cac/utils/model.go b/internal/cac/utils/model.go index c58b864..6b74f82 100644 --- a/internal/cac/utils/model.go +++ b/internal/cac/utils/model.go @@ -85,7 +85,9 @@ func FilterPatch(patch models.Rfc7396PatchOperation, filters []string) (models.R filter = mapped } - newPatch[filter] = patch[filter] + if _, ok := patch[filter]; ok { + newPatch[filter] = patch[filter] + } } return newPatch, nil