-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: add API calls for configuration set #853
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left 1 comment which is a must the rest is recommendations
Do you plan to add the assignment/unassignment API in a separate PR?
client/configuration_set.go
Outdated
|
||
if err := client.http.Get("/configuration", map[string]string{ | ||
"setId": setId, | ||
"organizationId": organizationId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't send the organizationId
it will return both the variables of the set and the organization...
You should send only the setId
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it! thanks!
client/configuration_set.go
Outdated
func (client *ApiClient) ConfigurationSets(scope string, scopeId string) ([]ConfigurationSet, error) { | ||
var result []ConfigurationSet | ||
var err error | ||
|
||
if scope == "organization" { | ||
scopeId, err = client.OrganizationId() | ||
if err != nil { | ||
return nil, err | ||
} | ||
} | ||
|
||
if err := client.http.Get("/configuration-sets", map[string]string{ | ||
"scope": scope, | ||
"scopeId": scopeId, | ||
"includeHigherScopes": "false", | ||
}, &result); err != nil { | ||
return nil, err | ||
} | ||
|
||
return result, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why you need this API...
In the FE we want to list the sets
do you plan to add all_sets data
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure I can remove it for now.
client/configuration_set.go
Outdated
} | ||
|
||
type ConfigurationSet struct { | ||
Id string `json:"id"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the return also contain the name
and the description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I know. Not really needed. But I'll add it.
yes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NICE work as always
Solution
Part of #829