Skip to content

Commit

Permalink
add filter
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Jogeleit <frank.jogeleit@web.de>
  • Loading branch information
fjogeleit committed Dec 15, 2023
1 parent 1fce846 commit b702610
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/database/bun.go
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,9 @@ func addPolicyReportResourceFilter(query *bun.SelectQuery, filter api.Filter) {
if len(filter.Sources) > 0 {
query.Where("res.source IN (?)", bun.In(filter.Sources))
}
if len(filter.Categories) > 0 {
query.Where("res.category IN (?)", bun.In(filter.Categories))
}
if filter.ResourceID != "" {
query.Where("res.id = ?", filter.ResourceID)
}
Expand Down

0 comments on commit b702610

Please sign in to comment.