Skip to content

Commit

Permalink
bug: grant resource doenst get query
Browse files Browse the repository at this point in the history
  • Loading branch information
Lifosmin Simon authored and Lifosmin Simon committed Sep 4, 2023
1 parent 2484217 commit 6e9b8d9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
Binary file added __debug_bin4270744017
Binary file not shown.
1 change: 1 addition & 0 deletions internal/store/postgres/grant_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ func applyGrantFilter(db *gorm.DB, filter domain.ListGrantsFilter) *gorm.DB {
if !filter.ExpirationDateGreaterThan.IsZero() {
db = db.Where(`"grants"."expiration_date" > ?`, filter.ExpirationDateGreaterThan)
}
db = db.Joins("Resource")
if filter.ProviderTypes != nil {
db = db.Where(`"Resource"."provider_type" IN ?`, filter.ProviderTypes)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/store/postgres/grant_repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (s *GrantRepositoryTestSuite) TestList() {
ProviderTypes: []string{s.dummyResource.ProviderType},
ProviderURNs: []string{s.dummyResource.ProviderURN},
ResourceTypes: []string{s.dummyResource.Type},
ResourceURNs: []string{s.dummyResource.URN},
ResourceURNs: []string{"x"},
CreatedBy: s.dummyAppeal.CreatedBy,
OrderBy: []string{"status"},
ExpirationDateLessThan: time.Now(),
Expand Down

0 comments on commit 6e9b8d9

Please sign in to comment.