Skip to content

Commit

Permalink
Merge pull request #1604 from openmeterio/fix/feature-list
Browse files Browse the repository at this point in the history
fix: list features by multiple Ids or Keys
  • Loading branch information
chrisgacsal authored Oct 1, 2024
2 parents d0c9d61 + cdfabf7 commit 9de3dd0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions openmeter/productcatalog/adapter/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,11 @@ func (c *featureDBAdapter) ListFeatures(ctx context.Context, params feature.List
Where(db_feature.Namespace(params.Namespace))

if len(params.MeterSlugs) > 0 {
query.Where(db_feature.MeterSlugIn(params.MeterSlugs...))
query = query.Where(db_feature.MeterSlugIn(params.MeterSlugs...))
}

if len(params.IDsOrKeys) > 0 {
for _, idOrKey := range params.IDsOrKeys {
query.Where(db_feature.Or(db_feature.Key(idOrKey), db_feature.ID(idOrKey)))
}
query = query.Where(db_feature.Or(db_feature.IDIn(params.IDsOrKeys...), db_feature.KeyIn(params.IDsOrKeys...)))
}

if !params.IncludeArchived {
Expand Down

0 comments on commit 9de3dd0

Please sign in to comment.