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:
@@ -8,8 +8,12 @@ import (
|
||||
|
||||
// https://docs.atlassian.com/jira/REST/cloud/#api/2/field-getFields
|
||||
func (j *Jira) GetFields() ([]jiradata.Field, error) {
|
||||
uri := fmt.Sprintf("%s/rest/api/2/field", j.Endpoint)
|
||||
resp, err := j.UA.GetJSON(uri)
|
||||
return GetFields(j.UA, j.Endpoint)
|
||||
}
|
||||
|
||||
func GetFields(ua HttpClient, endpoint string) ([]jiradata.Field, error) {
|
||||
uri := fmt.Sprintf("%s/rest/api/2/field", endpoint)
|
||||
resp, err := ua.GetJSON(uri)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user