diff --git a/ui/app/api/peers/create/route.ts b/ui/app/api/peers/create/route.ts index 0cbc660273..1930c3ee31 100644 --- a/ui/app/api/peers/create/route.ts +++ b/ui/app/api/peers/create/route.ts @@ -12,7 +12,7 @@ export async function POST(request: Request) { const flowServiceAddress = process.env.PEERDB_FLOW_SERVER_ADDRESS!; const flowServiceClient = GetFlowServiceClient(flowServiceAddress); const peer = constructPeer(name, type, config); - const req: CreatePeerRequest = {peer}; + const req: CreatePeerRequest = { peer }; const status: CreatePeerResponse = await flowServiceClient.createPeer(req); if (status.status === CreatePeerStatus.FAILED) { return new Response(status.message); diff --git a/ui/app/api/peers/util.ts b/ui/app/api/peers/util.ts index 3d58efdda1..f49f9ebacb 100644 --- a/ui/app/api/peers/util.ts +++ b/ui/app/api/peers/util.ts @@ -1,13 +1,17 @@ import { PeerConfig } from '@/app/peers/create/configuration/types'; -import { DBType, Peer, PostgresConfig, SnowflakeConfig } from '@/grpc_generated/peers'; +import { DBType, Peer, PostgresConfig } from '@/grpc_generated/peers'; -export const constructPeer = (name:string, type: string, config: PeerConfig):Peer|undefined => { +export const constructPeer = ( + name: string, + type: string, + config: PeerConfig +): Peer | undefined => { switch (type) { case 'POSTGRES': return { name, type: DBType.POSTGRES, - postgresConfig: config as PostgresConfig + postgresConfig: config as PostgresConfig, }; default: return; diff --git a/ui/app/api/peers/validate/route.ts b/ui/app/api/peers/validate/route.ts index 1ca6854c69..61f0329a1a 100644 --- a/ui/app/api/peers/validate/route.ts +++ b/ui/app/api/peers/validate/route.ts @@ -12,8 +12,9 @@ export async function POST(request: Request) { const flowServiceAddress = process.env.PEERDB_FLOW_SERVER_ADDRESS!; const flowServiceClient = GetFlowServiceClient(flowServiceAddress); const peer = constructPeer(name, type, config); - const req: ValidatePeerRequest = {peer}; - const status: ValidatePeerResponse = await flowServiceClient.validatePeer(req); + const req: ValidatePeerRequest = { peer }; + const status: ValidatePeerResponse = + await flowServiceClient.validatePeer(req); if (status.status === ValidatePeerStatus.INVALID) { return new Response(status.message); } else if (status.status === ValidatePeerStatus.VALID) { diff --git a/ui/app/peers/create/configuration/helpers/common.ts b/ui/app/peers/create/configuration/helpers/common.ts index 264ad58d90..66fa236a34 100644 --- a/ui/app/peers/create/configuration/helpers/common.ts +++ b/ui/app/peers/create/configuration/helpers/common.ts @@ -1,11 +1,10 @@ -import { blankPostgresSetting } from "./pg"; +import { blankPostgresSetting } from './pg'; export const getBlankSetting = (dbType: string) => { - switch (dbType) { - case 'POSTGRES': - return blankPostgresSetting; - default: - return blankPostgresSetting; - } - }; - \ No newline at end of file + switch (dbType) { + case 'POSTGRES': + return blankPostgresSetting; + default: + return blankPostgresSetting; + } +}; diff --git a/ui/app/peers/create/configuration/helpers/pg.ts b/ui/app/peers/create/configuration/helpers/pg.ts index fe72e20433..4790c0c1d6 100644 --- a/ui/app/peers/create/configuration/helpers/pg.ts +++ b/ui/app/peers/create/configuration/helpers/pg.ts @@ -42,4 +42,4 @@ export const blankPostgresSetting = { password: '', database: '', transactionSnapshot: '', -} +}; diff --git a/ui/app/peers/create/configuration/page.tsx b/ui/app/peers/create/configuration/page.tsx index a285cb9e22..b5873ded9f 100644 --- a/ui/app/peers/create/configuration/page.tsx +++ b/ui/app/peers/create/configuration/page.tsx @@ -10,9 +10,9 @@ import { useRouter, useSearchParams } from 'next/navigation'; import { useState } from 'react'; import PgConfig from './configForm'; import { handleCreate, handleValidate } from './handlers'; +import { getBlankSetting } from './helpers/common'; import { postgresSetting } from './helpers/pg'; import { PeerConfig } from './types'; -import { getBlankSetting } from './helpers/common'; export default function CreateConfig() { const searchParams = useSearchParams(); const router = useRouter(); diff --git a/ui/components/SelectSource.tsx b/ui/components/SelectSource.tsx index 6d73d5c6db..8e65b29293 100644 --- a/ui/components/SelectSource.tsx +++ b/ui/components/SelectSource.tsx @@ -8,12 +8,10 @@ interface SelectSourceProps { setPeerType: Dispatch>; } -export default function SelectSource({ - setPeerType, -}: SelectSourceProps) { +export default function SelectSource({ setPeerType }: SelectSourceProps) { const dbTypes: string[] = Object.values(DBType).filter( (value): value is string => - typeof value === 'string' && value === "POSTGRES" + typeof value === 'string' && value === 'POSTGRES' ); return (