unioslo / tsd-api-client

Command line client for the TSD HTTP API
BSD 3-Clause "New" or "Revised" License
13 stars 5 forks source link

Fix bug in file_api_url when page is set #127

Closed uio-torjus closed 10 months ago

uio-torjus commented 10 months ago

file_api_url returned invalid URL when page was supplied. For example:

file_api_url("test", "p1336", "survey", "123/attachments", per_page=50,page=1)
'https://test.api.tsd.usit.no1&per_page=50

This should fix this, making it return the expected value:

file_api_url("test", "p1336", "survey", "123/attachments", per_page=50,page=1)
'https://test.api.tsd.usit.no/v1/p1336/survey/123/attachments?per_page=50&page=1'

Also changes type annotation for page from str to int.