Skip to content

Commit

Permalink
feat: add filter on resource.name in list grants using query field (#116
Browse files Browse the repository at this point in the history
)
  • Loading branch information
bsushmith authored Dec 14, 2023
1 parent bf6a692 commit 5366eaf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/store/postgres/grant_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ func applyGrantFilter(db *gorm.DB, filter domain.ListGrantsFilter) *gorm.DB {
db = db.Where(db.
Where(`"grants"."account_id" LIKE ?`, fmt.Sprintf("%%%s%%", filter.Q)).
Or(`"grants"."role" LIKE ?`, fmt.Sprintf("%%%s%%", filter.Q)).
Or(`"resources"."urn" LIKE ?`, fmt.Sprintf("%%%s%%", filter.Q)),
Or(`"resources"."urn" LIKE ?`, fmt.Sprintf("%%%s%%", filter.Q)).
Or(`"resources"."name" LIKE ?`, fmt.Sprintf("%%%s%%", filter.Q)),
)
}
if filter.Size > 0 {
Expand Down

0 comments on commit 5366eaf

Please sign in to comment.