Skip to content

Commit

Permalink
Improve activist code pagination handling in ContactsSink
Browse files Browse the repository at this point in the history
  • Loading branch information
butkeraites-hotglue committed Jan 29, 2025
1 parent a4c6add commit 339cf45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion target_everyaction/sinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ def _get_all_activist_codes(self) -> dict:
for item in data["items"]:
all_codes[item["name"].lower()] = item["activistCodeId"]

if "nextPageLink" not in data:
# Check if there are more pages
if not data.get("nextPageLink"):
break

# Extract next page URL and make request
next_page = data["nextPageLink"].split("?")[1]
response = self.request_api("GET", endpoint=f"activistCodes?{next_page}")
else:
Expand Down

0 comments on commit 339cf45

Please sign in to comment.