lib/tracker_api/endpoints/stories.rb in tracker_api-0.1.0 vs lib/tracker_api/endpoints/stories.rb in tracker_api-0.2.0
- old
+ new
@@ -6,14 +6,10 @@
def initialize(client)
@client = client
end
def get(project_id, params={})
- data = client.request(
- method: :get,
- path: "/projects/#{project_id}/stories",
- params: params
- ).body
+ data = client.paginate("/projects/#{project_id}/stories", params: params)
raise TrackerApi::Errors::UnexpectedData, 'Array of stories expected' unless data.is_a? Array
data.map { |story| Resources::Story.new({ client: client }.merge(story)) }
end
end