Skip to content

Commit

Permalink
Merge pull request #419 from MUzairS15/MUzairS15/api/meshmodel
Browse files Browse the repository at this point in the history
update meshmodel api filter
  • Loading branch information
MUzairS15 authored Nov 27, 2023
2 parents 319f170 + 23f11a2 commit f8ee397
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions models/meshmodel/core/v1alpha1/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ func GetMeshModelComponents(db *database.Handler, f ComponentFilter) (c []Compon
finder = finder.Where("model_dbs.name = ?", f.ModelName)
}

if f.ReturnAnnotations {
if f.Annotations == "true" {
finder = finder.Where("component_definition_dbs.metadata->>'isAnnotation' = true")
} else if f.Annotations == "false" {
finder = finder.Where("component_definition_dbs.metadata->>'isAnnotation' = false")
}

if f.APIVersion != "" {
Expand Down Expand Up @@ -186,7 +188,7 @@ type ComponentFilter struct {
OrderOn string
Limit int //If 0 or unspecified then all records are returned and limit is not used
Offset int
ReturnAnnotations bool
Annotations string
}

// Create the filter from map[string]interface{}
Expand Down

0 comments on commit f8ee397

Please sign in to comment.