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 11:48:49 UTC

[incubator-devlake] branch main updated: fix(config-ui): github does not list private membership organizations (#4453)

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 fed170c51 fix(config-ui): github does not list private membership organizations (#4453)
fed170c51 is described below

commit fed170c51f976f8c0fc8ebc6a441bdd9d8c868fa
Author: 青湛 <0x...@gmail.com>
AuthorDate: Mon Feb 20 19:48:44 2023 +0800

    fix(config-ui): github does not list private membership organizations (#4453)
---
 config-ui/src/plugins/register/github/api.ts                          | 4 ++--
 .../register/github/components/miller-columns/use-miller-columns.ts   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/config-ui/src/plugins/register/github/api.ts b/config-ui/src/plugins/register/github/api.ts
index 66d7acc9c..46b43c54e 100644
--- a/config-ui/src/plugins/register/github/api.ts
+++ b/config-ui/src/plugins/register/github/api.ts
@@ -25,8 +25,8 @@ type PaginationParams = {
 
 export const getUser = (prefix: string) => request(`${prefix}/user`);
 
-export const getUserOrgs = (prefix: string, username: string, params: PaginationParams) =>
-  request(`${prefix}/users/${username}/orgs`, {
+export const getUserOrgs = (prefix: string, params: PaginationParams) =>
+  request(`${prefix}/user/orgs`, {
     method: 'get',
     data: params,
   });
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 65ea4cd1f..e93098581 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
@@ -84,7 +84,7 @@ export const useMillerColumns = ({ connectionId }: UseMillerColumnsProps) => {
   useEffect(() => {
     (async () => {
       const user = await API.getUser(prefix);
-      const orgs = await API.getUserOrgs(prefix, user.login, {
+      const orgs = await API.getUserOrgs(prefix, {
         page: 1,
         per_page: DEFAULT_PAGE_SIZE,
       });
@@ -149,7 +149,7 @@ export const useMillerColumns = ({ connectionId }: UseMillerColumnsProps) => {
 
       loaded = !repos.length || repos.length < DEFAULT_PAGE_SIZE;
     } else {
-      orgs = await API.getUserOrgs(prefix, user.login, {
+      orgs = await API.getUserOrgs(prefix, {
         page,
         per_page: DEFAULT_PAGE_SIZE,
       });