mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-06-25 00:16:45 +02:00
Remove FullComponent struct in favor of existing ProjectComponent
This commit is contained in:
13
component.go
13
component.go
@ -25,17 +25,8 @@ type CreateComponentOptions struct {
|
|||||||
ProjectID int `json:"projectId,omitempty" structs:"projectId,omitempty"`
|
ProjectID int `json:"projectId,omitempty" structs:"projectId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// FullComponent is a JIRA component with all details filled in
|
|
||||||
type FullComponent struct {
|
|
||||||
RealAssigneeType string `json:"realAssigneeType,omitempty" structs:"realAssigneeType,omitempty"`
|
|
||||||
RealAssignee *User `json:"realAssignee,omitempty" structs:"realAssignee,omitempty"`
|
|
||||||
IsAssigneeTypeValid bool `json:"isAssigneeTypeValid,omitempty" structs:"isAssigneeTypeValid,omitempty"`
|
|
||||||
|
|
||||||
CreateComponentOptions
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create creates a new JIRA component based on the given options.
|
// Create creates a new JIRA component based on the given options.
|
||||||
func (s *ComponentService) Create(options *CreateComponentOptions) (*FullComponent, *Response, error) {
|
func (s *ComponentService) Create(options *CreateComponentOptions) (*ProjectComponent, *Response, error) {
|
||||||
apiEndpoint := "rest/api/2/component"
|
apiEndpoint := "rest/api/2/component"
|
||||||
req, err := s.client.NewRequest("POST", apiEndpoint, options)
|
req, err := s.client.NewRequest("POST", apiEndpoint, options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -47,7 +38,7 @@ func (s *ComponentService) Create(options *CreateComponentOptions) (*FullCompone
|
|||||||
return nil, resp, err
|
return nil, resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
component := new(FullComponent)
|
component := new(ProjectComponent)
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
data, err := ioutil.ReadAll(resp.Body)
|
data, err := ioutil.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user