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


The following commit(s) were added to refs/heads/feat-dora-config by this push:
     new 8fc961c69 fix: adjust the return value for api
8fc961c69 is described below

commit 8fc961c69c6d6d8c797387ef02a507014ecfbc41
Author: mintsweet <[email protected]>
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);
   };
 

Reply via email to