From b72cfd5a7642490e36d6636bfb8fe83261f475a2 Mon Sep 17 00:00:00 2001 From: Dylan Jones Date: Tue, 20 Feb 2024 06:30:46 +0000 Subject: [PATCH] More data --- app/controllers/pub_thursday_audit_controller.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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|