Skip to content

Commit

Permalink
changes: rename Changes.DeleteDraftChange to DeleteChange (#95)
Browse files Browse the repository at this point in the history
* changes: rename Changes.DeleteDraftChange to DeleteChange

It was reported in #77 that the delete-draft-change API referenced in
the docs no longer exists. As suggested in the issue, just rename to
to Changes.DeleteChange.

* Update changes.go

Co-authored-by: Wade Carpenter <wwade@users.noreply.github.com>
Co-authored-by: Andy Grunwald <andygrunwald@gmail.com>
  • Loading branch information
3 people authored Sep 15, 2021
1 parent 34f3353 commit 668ecf2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions changes.go
Original file line number Diff line number Diff line change
Expand Up @@ -778,10 +778,13 @@ func (s *ChangesService) DeleteTopic(changeID string) (*Response, error) {
return s.client.DeleteRequest(u, nil)
}

// DeleteDraftChange deletes a draft change.
// DeleteChange deletes a new or abandoned change
//
// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-draft-change
func (s *ChangesService) DeleteDraftChange(changeID string) (*Response, error) {
// New or abandoned changes can be deleted by their owner if the user is granted the Delete Own Changes
// permission, otherwise only by administrators.
//
// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#delete-change
func (s *ChangesService) DeleteChange(changeID string) (*Response, error) {
u := fmt.Sprintf("changes/%s", changeID)
return s.client.DeleteRequest(u, nil)
}
Expand Down

0 comments on commit 668ecf2

Please sign in to comment.