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 9322b62f2 fix: check match items cannot iterable
9322b62f2 is described below
commit 9322b62f27e09d893e2977a42d34cc7dd6f0b17a
Author: mintsweet <[email protected]>
AuthorDate: Fri Sep 13 11:52:32 2024 +1200
fix: check match items cannot iterable
---
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 f29786b56..1c4e95eee 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[] }> =>
+): 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 ce9c2b12b..ac505ed4f 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.data });
+ dispatch({ type: 'APPEND', payload: res ? res.data : [] });
setPage(page + 1);
- setTotal(res.total);
+ setTotal(res?.total ?? 0);
setLoading(false);
};