From f9bea03c298fcec1a36454045ae08868729bff4a Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Tue, 10 Oct 2023 18:05:34 -0400 Subject: [PATCH] fix ui typing --- ui/app/mirrors/create/handlers.ts | 11 +++++++---- ui/app/mirrors/create/helpers/common.ts | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ui/app/mirrors/create/handlers.ts b/ui/app/mirrors/create/handlers.ts index 5654c480a2..9da47bb4b4 100644 --- a/ui/app/mirrors/create/handlers.ts +++ b/ui/app/mirrors/create/handlers.ts @@ -32,9 +32,12 @@ const validateFlowFields = ( }; const reformattedTableMapping = (tableMapping: TableMapRow[]) => { - const mapping: { [key: string]: string } = {}; - tableMapping.forEach((row) => { - mapping[row.source] = row.destination; + const mapping = tableMapping.map((row) => { + return { + sourceTableIdentifier: row.source, + destinationTableIdentifier: row.destination, + partitionKey: '', + }; }); return mapping; }; @@ -58,7 +61,7 @@ export const handleCreate = async ( const isValid = validateFlowFields(rows, setMsg, config); if (!isValid) return; const tableNameMapping = reformattedTableMapping(rows); - config['tableNameMapping'] = tableNameMapping; + config['tableMappings'] = tableNameMapping; config['flowJobName'] = flowJobName; setLoading(true); const statusMessage = await fetch('/api/mirrors/cdc', { diff --git a/ui/app/mirrors/create/helpers/common.ts b/ui/app/mirrors/create/helpers/common.ts index f7a5384e9f..9f15e676a9 100644 --- a/ui/app/mirrors/create/helpers/common.ts +++ b/ui/app/mirrors/create/helpers/common.ts @@ -20,7 +20,7 @@ export const blankCDCSetting: FlowConnectionConfigs = { destination: undefined, flowJobName: '', tableSchema: undefined, - tableNameMapping: {}, + tableMappings: [], srcTableIdNameMapping: {}, tableNameSchemaMapping: {}, metadataPeer: undefined,