From ab094687246b30974e9222ef7c837189b867e8d7 Mon Sep 17 00:00:00 2001 From: gizmo385 Date: Mon, 24 Jun 2024 06:35:40 +0000 Subject: [PATCH] Fix repository API to include private repos --- lazy_github/lib/github/repositories.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lazy_github/lib/github/repositories.py b/lazy_github/lib/github/repositories.py index 804bd5e..7231ef4 100644 --- a/lazy_github/lib/github/repositories.py +++ b/lazy_github/lib/github/repositories.py @@ -15,14 +15,12 @@ async def _list( sort: RepositorySortKey = "full_name", direction: SortDirection = "asc", page: int = 1, - per_page: int = 30, + per_page: int = 50, ) -> list[Repository]: """Retrieves Github repos matching the specified criteria""" query_params = {"type": repo_types, "direction": direction, "sort": sort, "page": page, "per_page": per_page} - user = await client.user() - response = await client.get( - f"/users/{user.login}/repos", headers=client.headers_with_auth_accept(), params=query_params - ) + response = await client.get("/user/repos", headers=client.headers_with_auth_accept(), params=query_params) + response.raise_for_status() return [Repository(**r) for r in response.json()]