Skip to content

Commit

Permalink
fix ui typing
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik committed Oct 10, 2023
1 parent e318628 commit f9bea03
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions ui/app/mirrors/create/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand All @@ -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', {
Expand Down
2 changes: 1 addition & 1 deletion ui/app/mirrors/create/helpers/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const blankCDCSetting: FlowConnectionConfigs = {
destination: undefined,
flowJobName: '',
tableSchema: undefined,
tableNameMapping: {},
tableMappings: [],
srcTableIdNameMapping: {},
tableNameSchemaMapping: {},
metadataPeer: undefined,
Expand Down

0 comments on commit f9bea03

Please sign in to comment.