Skip to content

Commit 204b135

Browse files
author
koval
committed
Fix list() method.
1 parent 997d449 commit 204b135

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

huntflow_api_client/entities/applicant_reponse.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ async def list(
1010
account_id: int,
1111
applicant_id: int,
1212
count: int = 30,
13-
next_page_cursor: int = 1,
13+
next_page_cursor: str | None = None,
1414
) -> ApplicantResponsesListResponse:
1515
"""
1616
API method reference:
@@ -21,13 +21,11 @@ async def list(
2121
:param count: Number of items per page
2222
:param next_page_cursor: Next page cursor
2323
24-
:return: List of applicant's worklog
24+
:return: List of applicant's responses from job sites
2525
"""
2626
path = f"/accounts/{account_id}/applicants/{applicant_id}/responses"
27-
params: Dict[str, Any] = {
28-
"count": count,
29-
"next_page_cursor": next_page_cursor,
30-
}
31-
27+
params: Dict[str, Any] = {"count": count}
28+
if next_page_cursor:
29+
params["next_page_cursor"] = next_page_cursor
3230
response = await self._api.request("GET", path, params=params)
3331
return ApplicantResponsesListResponse.model_validate(response.json())

tests/test_entities/test_applicant_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async def test_applicant_response_list(
3838
) -> None:
3939
httpx_mock.add_response(
4040
url=f"{VERSIONED_BASE_URL}/accounts/{ACCOUNT_ID}/applicants/{APPLICANT_ID}/responses"
41-
"?count=30&next_page_cursor=1",
41+
"?count=30",
4242
status_code=200,
4343
json=APPLICANT_RESPONSE_LIST_RESPONSE,
4444
)

0 commit comments

Comments
 (0)