From 80d31a7ab40849d99c30fcbd05d1befc3f3d804e Mon Sep 17 00:00:00 2001 From: Amogh-Bharadwaj Date: Tue, 21 Jan 2025 05:02:48 +0530 Subject: [PATCH] lint --- flow/connectors/clickhouse/clickhouse.go | 2 +- ui/app/mirrors/[mirrorId]/edit/page.tsx | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/flow/connectors/clickhouse/clickhouse.go b/flow/connectors/clickhouse/clickhouse.go index a3db0981e..cc8ee54cd 100644 --- a/flow/connectors/clickhouse/clickhouse.go +++ b/flow/connectors/clickhouse/clickhouse.go @@ -38,10 +38,10 @@ type ClickHouseConnector struct { type ClickHouseDestinationCheckInput struct { TableMappings []*protos.TableMapping + TableNameSchemaMapping map[string]*protos.TableSchema SyncedAtColName string Resync bool DoInitialSnapshot bool - TableNameSchemaMapping map[string]*protos.TableSchema } func ValidateS3(ctx context.Context, creds *utils.ClickHouseS3Credentials) error { diff --git a/ui/app/mirrors/[mirrorId]/edit/page.tsx b/ui/app/mirrors/[mirrorId]/edit/page.tsx index b4f7c20c9..758148989 100644 --- a/ui/app/mirrors/[mirrorId]/edit/page.tsx +++ b/ui/app/mirrors/[mirrorId]/edit/page.tsx @@ -121,16 +121,22 @@ const EditMirror = ({ params: { mirrorId } }: EditMirrorProps) => { addedTables: additionalTables, }; - const res = await fetch('/api/v1/mirrors/cdc/edit/validate', { - method: 'POST', - body: JSON.stringify(validateReq), - cache: 'no-store', - }); + try { + const res = await fetch('/api/v1/mirrors/cdc/edit/validate', { + method: 'POST', + body: JSON.stringify(validateReq), + cache: 'no-store', + }); - if (!res.ok) { - notifyErr(`Table addition invalidated: ${res.statusText}`); + if (!res.ok) { + const errRes = await res.json(); + notifyErr('Table addition invalidated: ' + errRes.message); + setLoading(false); + return; + } + } catch (e) { + console.error(e); setLoading(false); - return; } } const req: FlowStateChangeRequest = {