Skip to content

Commit

Permalink
Merge pull request #350 from Freedisch/fix_dbname
Browse files Browse the repository at this point in the history
fix Getpolicies
  • Loading branch information
leecalcote authored Aug 18, 2023
2 parents 81e3242 + 54b9848 commit 0d38af8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion models/meshmodel/core/v1alpha1/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ type PolicyDefinitionDB struct {

type PolicyFilter struct {
Kind string
Greedy bool
SubType string
ModelName string
OrderOn string
Sort string
Limit int
Offset int
}

func (pf *PolicyFilter) Create(m map[string]interface{}) {
Expand All @@ -57,7 +62,7 @@ func GetMeshModelPolicy(db *database.Handler, f PolicyFilter) (pl []PolicyDefini
}
var componentDefinitionsWithModel []componentDefinitionWithModel
finder := db.Model(&PolicyDefinitionDB{}).
Select("policy_definition_dbs.*, models.*").
Select("policy_definition_dbs.*, models_dbs.*").
Joins("JOIN model_dbs ON model_dbs.id = policy_definition_dbs.model_id")
if f.Kind != "" {
finder = finder.Where("policy_definition_dbs.kind = ?", f.Kind)
Expand Down

0 comments on commit 0d38af8

Please sign in to comment.