From 5366eaf167ae2fbe44f90bb68ae31251bb76c032 Mon Sep 17 00:00:00 2001 From: sushmith <6890568+bsushmith@users.noreply.github.com> Date: Thu, 14 Dec 2023 11:57:22 +0530 Subject: [PATCH] feat: add filter on resource.name in list grants using query field (#116) --- internal/store/postgres/grant_repository.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/store/postgres/grant_repository.go b/internal/store/postgres/grant_repository.go index aae21370e..287f6b316 100644 --- a/internal/store/postgres/grant_repository.go +++ b/internal/store/postgres/grant_repository.go @@ -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 {