mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-07-15 01:04:38 +02:00
Change POST method to PUT method in UpdateComment
This commit is contained in:
2
issue.go
2
issue.go
@ -718,7 +718,7 @@ func (s *IssueService) UpdateComment(issueID string, comment *Comment) (*Comment
|
|||||||
Body: comment.Body,
|
Body: comment.Body,
|
||||||
}
|
}
|
||||||
apiEndpoint := fmt.Sprintf("rest/api/2/issue/%s/comment/%s", issueID, comment.ID)
|
apiEndpoint := fmt.Sprintf("rest/api/2/issue/%s/comment/%s", issueID, comment.ID)
|
||||||
req, err := s.client.NewRequest("POST", apiEndpoint, reqBody)
|
req, err := s.client.NewRequest("PUT", apiEndpoint, reqBody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ func TestIssueService_UpdateComment(t *testing.T) {
|
|||||||
setup()
|
setup()
|
||||||
defer teardown()
|
defer teardown()
|
||||||
testMux.HandleFunc("/rest/api/2/issue/10000/comment/10001", func(w http.ResponseWriter, r *http.Request) {
|
testMux.HandleFunc("/rest/api/2/issue/10000/comment/10001", func(w http.ResponseWriter, r *http.Request) {
|
||||||
testMethod(t, r, "POST")
|
testMethod(t, r, "PUT")
|
||||||
testRequestURL(t, r, "/rest/api/2/issue/10000/comment/10001")
|
testRequestURL(t, r, "/rest/api/2/issue/10000/comment/10001")
|
||||||
|
|
||||||
w.WriteHeader(http.StatusCreated)
|
w.WriteHeader(http.StatusCreated)
|
||||||
|
Reference in New Issue
Block a user