Skip to content

Commit b13ac0d

Browse files
committed
Fix each page block return bug
1 parent 0338cb0 commit b13ac0d

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

lib/sentry-api/client/projects.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def project_events(project_slug)
155155
# SentryApi.project_event('project-slug', 'event-id')
156156
#
157157
# @param project_slug [String] the slug of the project the client keys belong to.
158-
# @param event_id [String] the slug of the project the event belongs to.
158+
# @param event_id [String] the hexadecimal ID of the event to retrieve (as reported by the raven client)
159159
# @return [SentryApi::ObjectifiedHash]
160160
def project_event(project_slug, event_id)
161161
get("/projects/#{@default_org_slug}/#{project_slug}/events/#{event_id}/")

lib/sentry-api/paginated_response.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def has_next_page?
6060

6161
def next_page
6262
return nil if @client.nil? || !has_next_page?
63-
@links.next
63+
path = @links.next.sub(/#{@client.endpoint}/, '')
64+
@client.get(path)
6465
end
6566

6667
def has_prev_page?
@@ -69,7 +70,8 @@ def has_prev_page?
6970

7071
def prev_page
7172
return nil if @client.nil? || !has_prev_page?
72-
@links.previous
73+
path = @links.prev.sub(/#{@client.endpoint}/, '')
74+
@client.get(path)
7375
end
7476
end
7577
end

lib/sentry-api/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module SentryApi
2-
VERSION = "0.3.1"
2+
VERSION = "0.3.2"
33
end

spec/sentry-api/paginated_response_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
allow(client).to receive(:endpoint).and_return("http://example.com/api/0")
2121
expect(@paginated_response.has_next_page?).to be true
2222
expect(@paginated_response.has_prev_page?).to be false
23-
expect(@paginated_response.next_page).to eql 'http://example.com/api/0/organizations/?&cursor=100:1:0'
24-
expect(@paginated_response.prev_page).to be_nil
2523
end
2624
end
2725

0 commit comments

Comments
 (0)