Skip to content

Commit

Permalink
scopeId filter instead of scope type
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerHeber committed Nov 24, 2023
1 parent 8186b6f commit 855a93f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/configuration_variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (client *ApiClient) ConfigurationVariablesByScope(scope Scope, scopeId stri
// The API returns variables of upper scopes. Filter them out.
var filteredVariables []ConfigurationVariable
for _, variable := range result {
if scope == variable.Scope {
if scopeId == variable.ScopeId {
filteredVariables = append(filteredVariables, variable)
}
}
Expand Down
3 changes: 2 additions & 1 deletion client/configuration_variable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ var _ = Describe("Configuration Variable", func() {
Value: "ignore",
OrganizationId: organizationId,
Scope: ScopeTemplate,
ScopeId: "scope-id",
}

Describe("ConfigurationVariable", func() {
Expand Down Expand Up @@ -260,7 +261,7 @@ var _ = Describe("Configuration Variable", func() {
})

Describe("ConfigurationVariablesByScope", func() {
scopeId := "scope-id"
scopeId := mockTemplateConfigurationVariable.ScopeId

var returnedVariables []ConfigurationVariable
mockVariables := []ConfigurationVariable{mockTemplateConfigurationVariable}
Expand Down

0 comments on commit 855a93f

Please sign in to comment.