Skip to content

Commit

Permalink
Method is added to search teams API
Browse files Browse the repository at this point in the history
  • Loading branch information
shaikhmudassir authored and kraktus committed Aug 14, 2023
1 parent d849519 commit bc93b21
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions berserk/clients/teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,20 @@ def teams_of_player(self, username: str) -> List[Team]:
def get_popular_teams(self, page: int = 1) -> PaginatedTeams:
"""Get the most popular teams
:param page: the page number that needs to be returned (Optional)
:return: A paginated list of the most popular teams.
"""
path = "/api/team/all"
params = {"page": page}
return cast(PaginatedTeams, self._r.get(path, params=params))

def search_teams(self, text: str, page: int = 1) -> PaginatedTeams:
"""Search for teams
:param text: the query text to search for
:param page: the page number that needs to be returned (Optional)
:return: The paginated list of teams.
"""
path = "/api/team/search"
params = {"text": text, "page": page}
return cast(PaginatedTeams, self._r.get(path, params=params))

0 comments on commit bc93b21

Please sign in to comment.