mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-18 20:23:28 +02:00
refactor trivial objects in favor of arguments to static functions
This commit is contained in:
+6
-2
@@ -8,8 +8,12 @@ import (
|
||||
|
||||
// https://docs.atlassian.com/jira/REST/cloud/#api/2/project-getProjectComponents
|
||||
func (j *Jira) GetProjectComponents(project string) (*jiradata.Components, error) {
|
||||
uri := fmt.Sprintf("%s/rest/api/2/project/%s/components", j.Endpoint, project)
|
||||
resp, err := j.UA.GetJSON(uri)
|
||||
return GetProjectComponents(j.UA, j.Endpoint, project)
|
||||
}
|
||||
|
||||
func GetProjectComponents(ua HttpClient, endpoint string, project string) (*jiradata.Components, error) {
|
||||
uri := fmt.Sprintf("%s/rest/api/2/project/%s/components", endpoint, project)
|
||||
resp, err := ua.GetJSON(uri)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user