Skip to content

Commit 05503d0

Browse files
committed
Return values array from response
Returning an array of the data rather than the entire response to allow iteration over
1 parent 29de671 commit 05503d0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/bitbucket_rest_api/teams.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def initialize(options = { })
1010

1111
def list(user_role)
1212
response = get_request("/2.0/teams/?role=#{user_role.to_s}")
13-
return response unless block_given?
13+
return response["values"] unless block_given?
1414
response["values"].each { |el| yield el }
1515
end
1616

@@ -20,25 +20,25 @@ def profile(team_name)
2020

2121
def members(team_name)
2222
response = get_request("/2.0/teams/#{team_name.to_s}/members")
23-
return response unless block_given?
23+
return response["values"] unless block_given?
2424
response["values"].each { |el| yield el }
2525
end
2626

2727
def followers(team_name)
2828
response = get_request("/2.0/teams/#{team_name.to_s}/followers")
29-
return response unless block_given?
29+
return response["values"] unless block_given?
3030
response["values"].each { |el| yield el }
3131
end
3232

3333
def following(team_name)
3434
response = get_request("/2.0/teams/#{team_name.to_s}/following")
35-
return response unless block_given?
35+
return response["values"] unless block_given?
3636
response["values"].each { |el| yield el }
3737
end
3838

3939
def repos(team_name)
4040
response = get_request("/2.0/repositories/#{team_name.to_s}")
41-
return response unless block_given?
41+
return response["values"] unless block_given?
4242
response["values"].each { |el| yield el }
4343
end
4444

0 commit comments

Comments
 (0)