fix bugs
This commit is contained in:
@@ -3,6 +3,7 @@ from dataclasses import dataclass, field, fields
|
||||
from json import loads
|
||||
from os import environ
|
||||
from typing import Any, Callable, Self, TypedDict
|
||||
from urllib.error import HTTPError
|
||||
|
||||
from .hints import JSONDataMap
|
||||
from .requests import get, put
|
||||
@@ -124,15 +125,19 @@ class ClickupSession:
|
||||
base_url: str = "https://api.clickup.com/api/v2"
|
||||
|
||||
def _get(self, endpoint: str, **query_params: str) -> JSONDataMap:
|
||||
raw_data = get(
|
||||
self.base_url + endpoint,
|
||||
query_params,
|
||||
headers={
|
||||
"accept": "application/json",
|
||||
"Authorization": self.auth_key,
|
||||
},
|
||||
)
|
||||
return loads(raw_data)
|
||||
try:
|
||||
raw_data = get(
|
||||
self.base_url + endpoint,
|
||||
query_params,
|
||||
headers={
|
||||
"accept": "application/json",
|
||||
"Authorization": self.auth_key,
|
||||
},
|
||||
)
|
||||
return loads(raw_data)
|
||||
except HTTPError as e:
|
||||
e.add_note(e.url)
|
||||
raise
|
||||
|
||||
def _put(self, endpoint: str, **body_params: str) -> JSONDataMap:
|
||||
raw_data = put(
|
||||
|
||||
Reference in New Issue
Block a user