Skip to content

Commit

Permalink
fix(repository): fix edition filter
Browse files Browse the repository at this point in the history
  • Loading branch information
donch1989 committed Dec 4, 2024
1 parent 56c2d38 commit 2f814c7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,12 +767,8 @@ func (r *repository) ListComponentDefinitionUIDs(_ context.Context, p ListCompon
Where(where, whereArgs...).
Where("is_visible IS TRUE")


// TODO: refactor it with store.go in ins-7031
if config.Config.Server.Edition == config.EditionLocalCE {
skipComponentsInCE := []string{"instill-app"}
queryBuilder = queryBuilder.Where("id NOT IN (?)", skipComponentsInCE)
} else if config.Config.Server.Edition == config.EditionCloudStaging || config.Config.Server.Edition == config.EditionCloudProd {
if config.Config.Server.Edition == config.EditionCloudStaging || config.Config.Server.Edition == config.EditionCloudProd {
skipComponentsInCloud := []string{"google-drive", "google-sheets"}
queryBuilder = queryBuilder.Where("id NOT IN (?)", skipComponentsInCloud)
}
Expand Down Expand Up @@ -878,6 +874,11 @@ func (r *repository) ListIntegrations(ctx context.Context, p ListIntegrationsPar
Where(where, whereArgs...).
Where("is_visible IS TRUE AND has_integration IS TRUE")

if config.Config.Server.Edition == config.EditionCloudStaging || config.Config.Server.Edition == config.EditionCloudProd {
skipComponentsInCloud := []string{"google-drive", "google-sheets"}
queryBuilder = queryBuilder.Where("id NOT IN (?)", skipComponentsInCloud)
}

var count int64
queryBuilder.Count(&count)
resp.TotalSize = int32(count)
Expand Down

0 comments on commit 2f814c7

Please sign in to comment.