Skip to content

Commit b8af0a6

Browse files
fix tenant flag (#308)
1 parent 77b7d52 commit b8af0a6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

internal/wrappers/groups-http.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,14 @@ type Group struct {
2525
}
2626

2727
func NewHTTPGroupsWrapper(path string) GroupsWrapper {
28-
tenant := viper.GetString(commonParams.TenantKey)
29-
tenantPath := strings.Replace(path, "organization", tenant, 1)
30-
31-
return &GroupsHTTPWrapper{path: tenantPath}
28+
return &GroupsHTTPWrapper{path: path}
3229
}
3330

3431
func (g *GroupsHTTPWrapper) Get(groupName string) ([]Group, error) {
3532
clientTimeout := viper.GetUint(commonParams.ClientTimeoutKey)
36-
reportPath := fmt.Sprintf("%s?groupName=%s", g.path, groupName)
33+
tenant := viper.GetString(commonParams.TenantKey)
34+
tenantPath := strings.Replace(g.path, "organization", tenant, 1)
35+
reportPath := fmt.Sprintf("%s?groupName=%s", tenantPath, groupName)
3736
resp, err := SendHTTPRequest(http.MethodGet, reportPath, nil, true, clientTimeout)
3837
if err != nil {
3938
return nil, err

0 commit comments

Comments
 (0)