Skip to content

Commit

Permalink
Merge pull request #80 from rogers-obrien-rad/hotfix/no-ref/list-rfis
Browse files Browse the repository at this point in the history
Hotfix/no ref/list rfis
  • Loading branch information
HagenFritz authored Nov 19, 2024
2 parents 3d8ddac + f1b93b5 commit 88a5732
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,5 @@ replay_pid*
*.lock

# snippet testing files
*snippets_*
*snippets_*
specs/
33 changes: 22 additions & 11 deletions ProPyCore/access/rfis.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,31 @@ def get(self, company_id, project_id, page=1, per_page=100):
rfis : dict
available rfi data
"""
params = {
"page": page,
"per_page": per_page
}

headers = {
"Procore-Company-Id": f"{company_id}"
}

rfis = self.get_request(
api_url=f"{self.endpoint}/{project_id}/rfis",
additional_headers=headers,
params=params
)
n_rfis = 1
page = 1
rfis = []
while n_rfis > 0:
params = {
"page": page,
"per_page": 100
}

headers = {
"Procore-Company-Id": f"{company_id}"
}

rfi_selection = self.get_request(
api_url=f"{self.endpoint}/{project_id}/rfis",
additional_headers=headers,
params=params
)

n_rfis = len(rfi_selection)
rfis += rfi_selection
page += 1

return rfis

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

setup(
name="ProPyCore",
version="0.1.2",
version="0.1.3",
author="Hagen E. Fritz",
author_email="hfritz@r-o.com",
description="Interact with Procore through Python for data connection applications",
Expand Down

0 comments on commit 88a5732

Please sign in to comment.