Skip to content

Commit

Permalink
Fix filter overrides with nil (#24)
Browse files Browse the repository at this point in the history
* fix filter overrides with nil

* fix typo

* remove unnecesary changes
  • Loading branch information
piotrek-janus authored Jul 17, 2024
1 parent 773f457 commit 57f2a98
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions internal/cac/storage/multi.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion internal/cac/storage/tenant_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 3 additions & 1 deletion internal/cac/utils/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 57f2a98

Please sign in to comment.