You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by mi...@apache.org on 2024/09/14 00:08:00 UTC

(incubator-devlake) 11/13: fix: adjust the return value for api

This is an automated email from the ASF dual-hosted git repository.

mintsweet pushed a commit to branch feat-dora-config
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit b91f0166391df577ac03356d5454539420c832ed
Author: mintsweet <0x...@gmail.com>
AuthorDate: Fri Sep 13 20:47:27 2024 +1200

    fix: adjust the return value for api
---
 config-ui/src/api/scope-config/index.ts                        | 2 +-
 config-ui/src/plugins/components/check-matched-items/index.tsx | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/config-ui/src/api/scope-config/index.ts b/config-ui/src/api/scope-config/index.ts
index 1c4e95eee..2bb23d422 100644
--- a/config-ui/src/api/scope-config/index.ts
+++ b/config-ui/src/api/scope-config/index.ts
@@ -51,7 +51,7 @@ export const transform2deployments = (
     deploymentPattern: string;
     productionPattern: string;
   } & Pagination,
-): Promise<{ total: number; data: ITransform2deployments[] } | null> =>
+): Promise<{ total: number; data: ITransform2deployments[] | null }> =>
   request(`/plugins/${plugin}/connections/${connectionId}/transform-to-deployments`, {
     method: 'post',
     data,
diff --git a/config-ui/src/plugins/components/check-matched-items/index.tsx b/config-ui/src/plugins/components/check-matched-items/index.tsx
index ac505ed4f..bdfcde2ff 100644
--- a/config-ui/src/plugins/components/check-matched-items/index.tsx
+++ b/config-ui/src/plugins/components/check-matched-items/index.tsx
@@ -55,10 +55,10 @@ export const CheckMatchedItems = ({ plugin, connectionId, transformation }: Prop
       pageSize: 10,
     });
 
-    dispatch({ type: 'APPEND', payload: res ? res.data : [] });
+    dispatch({ type: 'APPEND', payload: res.data ?? [] });
 
     setPage(page + 1);
-    setTotal(res?.total ?? 0);
+    setTotal(res.total);
     setLoading(false);
   };