You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by li...@apache.org on 2023/02/20 07:12:24 UTC
[incubator-devlake] branch main updated: fix(config-ui): github does not list private repositories (#4451)
This is an automated email from the ASF dual-hosted git repository.
likyh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new 7e586c977 fix(config-ui): github does not list private repositories (#4451)
7e586c977 is described below
commit 7e586c977bdfbda4b397bfcf3787ae431a06907c
Author: 青湛 <0x...@gmail.com>
AuthorDate: Mon Feb 20 15:12:20 2023 +0800
fix(config-ui): github does not list private repositories (#4451)
---
config-ui/src/plugins/register/github/api.ts | 9 ++++++---
.../github/components/miller-columns/use-miller-columns.ts | 4 ++--
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/config-ui/src/plugins/register/github/api.ts b/config-ui/src/plugins/register/github/api.ts
index dddf94570..66d7acc9c 100644
--- a/config-ui/src/plugins/register/github/api.ts
+++ b/config-ui/src/plugins/register/github/api.ts
@@ -37,10 +37,13 @@ export const getOrgRepos = (prefix: string, org: string, params: PaginationParam
data: params,
});
-export const getUserRepos = (prefix: string, username: string, params: PaginationParams) =>
- request(`${prefix}/users/${username}/repos`, {
+export const getUserRepos = (prefix: string, params: PaginationParams) =>
+ request(`${prefix}/user/repos`, {
method: 'get',
- data: params,
+ data: {
+ ...params,
+ type: 'owner',
+ },
});
type SearchRepoParams = {
diff --git a/config-ui/src/plugins/register/github/components/miller-columns/use-miller-columns.ts b/config-ui/src/plugins/register/github/components/miller-columns/use-miller-columns.ts
index dcafcba97..65ea4cd1f 100644
--- a/config-ui/src/plugins/register/github/components/miller-columns/use-miller-columns.ts
+++ b/config-ui/src/plugins/register/github/components/miller-columns/use-miller-columns.ts
@@ -111,7 +111,7 @@ export const useMillerColumns = ({ connectionId }: UseMillerColumnsProps) => {
const isUser = id === user.login;
const repos = isUser
- ? await API.getUserRepos(prefix, user.login, {
+ ? await API.getUserRepos(prefix, {
page: 1,
per_page: DEFAULT_PAGE_SIZE,
})
@@ -138,7 +138,7 @@ export const useMillerColumns = ({ connectionId }: UseMillerColumnsProps) => {
const item = items.find((it) => it.id === id) as McsItem<ExtraType>;
repos = isUser
- ? await API.getUserRepos(prefix, user.login, {
+ ? await API.getUserRepos(prefix, {
page,
per_page: DEFAULT_PAGE_SIZE,
})