diff --git a/app/controllers/pub_thursday_audit_controller.rb b/app/controllers/pub_thursday_audit_controller.rb index 401a43c..366f0d6 100644 --- a/app/controllers/pub_thursday_audit_controller.rb +++ b/app/controllers/pub_thursday_audit_controller.rb @@ -26,8 +26,16 @@ def index response = JSON.parse(RestClient.get(url).body) documents.concat response["documents"] - url = "#{url}&pageToken=#{response["nextPageToken"]}" - response = JSON.parse(RestClient.get(url).body) + next_page = "#{url}&pageToken=#{response["nextPageToken"]}" + response = JSON.parse(RestClient.get(next_page).body) + documents.concat response["documents"] + + next_page = "#{url}&pageToken=#{response["nextPageToken"]}" + response = JSON.parse(RestClient.get(next_page).body) + documents.concat response["documents"] + + next_page = "#{url}&pageToken=#{response["nextPageToken"]}" + response = JSON.parse(RestClient.get(next_page).body) documents.concat response["documents"] documents.each do |session|