Skip to content

Commit

Permalink
Merge pull request #9 from mindjolt/ATRIBEC-1388
Browse files Browse the repository at this point in the history
Update api.py
  • Loading branch information
gpereyraJC authored Sep 24, 2024
2 parents 7823472 + 9cf9431 commit f00fff7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions adjust/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

from .model import RawCallback, App, AppsResponse, Callback, Event, EventsResponse, Placeholder, User, UserToken


T = TypeVar("T")


Expand Down Expand Up @@ -102,7 +101,7 @@ def _api(self, type: Type[T], path: str, method: str = "GET", **data: Any) -> T:
# Crear un diccionario del user
user_data = {'id': '10', 'email': userEmail, 'name': 'Admin'}
user_token = UserToken(id=int(user_data['id']), email=user_data['email'], name=user_data['name'])
user = user_token_to_user(user_token)
user = self._user_token_to_user(user_token)
return parse_obj_as(type, user)

return parse_obj_as(type, None if r.status_code == 204 else r.json())
Expand Down Expand Up @@ -198,7 +197,7 @@ def update_callback(self, app: App | str, callback: Callback) -> None:
path = f"dashboard/api/apps/{token}/event_types/{callback.id}/callback"
self._api(NoneType, path, method="PUT", callback_url=callback.url)

def user_token_to_user(user_token: UserToken) -> User:
def _user_token_to_user(user_token: UserToken) -> User:
"""Transforms a UserToken object into a User object.
Args:
Expand Down

0 comments on commit f00fff7

Please sign in to comment.