fix: use httpx query parameters to correctly URL encode since timestamp
This commit is contained in:
+4
-3
@@ -400,10 +400,11 @@ class GiteaClient(IssuesClient, PullRequestsClient, FilesClient, RefsClient, Rep
|
||||
def list_unread_notifications(self, since: Optional[str] = None) -> list[dict[str, Any]]:
|
||||
try:
|
||||
with httpx.Client() as client:
|
||||
url = f"{self.base_url}/api/v1/notifications?all=false"
|
||||
url = f"{self.base_url}/api/v1/notifications"
|
||||
params: dict[str, str] = {"all": "false"}
|
||||
if since:
|
||||
url += f"&since={since}"
|
||||
response = client.get(url, headers=self.headers)
|
||||
params["since"] = since
|
||||
response = client.get(url, headers=self.headers, params=params)
|
||||
response.raise_for_status()
|
||||
notifications: list[dict[str, Any]] = response.json()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user