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 22dbc6ff60123c24d913d36e25d968cd728272c5 Author: mintsweet <0x1304...@gmail.com> 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); };