From ced419484dc446286604d370e237a9192f5ad3a2 Mon Sep 17 00:00:00 2001 From: mintsweet <0x1304570@gmail.com> Date: Fri, 13 Sep 2024 11:52:32 +1200 Subject: [PATCH] fix: check match items cannot iterable --- config-ui/src/api/scope-config/index.ts | 2 +- .../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 f29786b563f..1c4e95eee69 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 ce9c2b12b66..ac505ed4fde 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); };