Skip to content

Commit 64ac150

Browse files
committed
use path from page in file_api_url, when page is not empty
1 parent 7c65625 commit 64ac150

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tsdapiclient/tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ def file_api_url(
9393
if formid:
9494
endpoint = f'{formid}/{endpoint}'
9595
scheme = 'http' if env == 'dev' else 'https'
96+
if page is not None:
97+
return f"{scheme}://{host}/{page}"
9698
path = os.path.normpath(f"{host}/{API_VERSION}/{pnum}/{service}/{endpoint}")
9799
url = f'{scheme}://{path}'
98100
if url.endswith('/'):
@@ -101,8 +103,6 @@ def file_api_url(
101103
query_dict = {}
102104
if per_page:
103105
query_dict["per_page"] = per_page
104-
if page is not None:
105-
query_dict["page"] = page
106106
if len(query_dict) > 0:
107107
url += f'?{urlencode(query_dict)}'
108108

0 commit comments

Comments
 (0)