Skip to content

Commit

Permalink
Bitbucket deprecated its API v1.0: update all endpoints to API v2.0 (p…
Browse files Browse the repository at this point in the history
…rontolabs#348)

* Bitbucket deprecated its API v1.0: update all endpoints to API v2.0
(pull_requests wasn't updated)

* Fix issue of approve_pull_request and unapprove_pull_request method
  • Loading branch information
starchow authored and doomspork committed Jul 1, 2019
1 parent 59dd7a9 commit 3f03b0b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/pronto/clients/bitbucket_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def pull_comments(slug, pull_id)
end

def pull_requests(slug)
response = get("#{pull_request_api(slug)}/pullrequests?state=OPEN")
response = get("/#{slug}/pullrequests?state=OPEN")
openstruct(response['values'])
end

Expand All @@ -30,11 +30,11 @@ def create_pull_comment(slug, pull_id, body, path, position)
end

def approve_pull_request(slug, pull_id)
self.class.post("#{slug}/pullrequests/#{pull_id}/approve")
self.class.post("/#{slug}/pullrequests/#{pull_id}/approve")
end

def unapprove_pull_request(slug, pull_id)
self.class.delete("#{slug}/pullrequests/#{pull_id}/approve")
self.class.delete("/#{slug}/pullrequests/#{pull_id}/approve")
end

private
Expand Down

0 comments on commit 3f03b0b

Please sign in to comment.