Fix the error when submitting remote service form (#3579)
* Fix the error when submitting remote service form Fix the exception caused by data structure errors when submitting remote service forms. * fix for Prettier * typing --------- Co-authored-by: wangyj20 <wangyj20@asiainfo.com> Co-authored-by: Toshii <94262432+0xToshii@users.noreply.github.com>
This commit is contained in:
1 file changed
+3
-2
@@ -2,6 +2,7 @@ import { LINKS } from "@/constants"
|
||||
import { useExtensionState } from "@/context/ExtensionStateContext"
|
||||
import { McpServiceClient } from "@/services/grpc-client"
|
||||
import { convertProtoMcpServersToMcpServers } from "@shared/proto-conversions/mcp/mcp-server-conversion"
|
||||
import { McpServers } from "@shared/proto/mcp"
|
||||
import { EmptyRequest } from "@shared/proto/common"
|
||||
import { AddRemoteMcpServerRequest } from "@shared/proto/mcp"
|
||||
import { VSCodeButton, VSCodeLink, VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
|
||||
@@ -40,7 +41,7 @@ const AddRemoteServerForm = ({ onServerAdded }: { onServerAdded: () => void }) =
|
||||
setShowConnectingMessage(true)
|
||||
|
||||
try {
|
||||
const servers = await McpServiceClient.addRemoteMcpServer(
|
||||
const servers: McpServers = await McpServiceClient.addRemoteMcpServer(
|
||||
AddRemoteMcpServerRequest.create({
|
||||
serverName: serverName.trim(),
|
||||
serverUrl: serverUrl.trim(),
|
||||
@@ -49,7 +50,7 @@ const AddRemoteServerForm = ({ onServerAdded }: { onServerAdded: () => void }) =
|
||||
|
||||
setIsSubmitting(false)
|
||||
|
||||
const mcpServers = convertProtoMcpServersToMcpServers(servers)
|
||||
const mcpServers = convertProtoMcpServersToMcpServers(servers.mcpServers)
|
||||
setMcpServers(mcpServers)
|
||||
|
||||
setServerName("")
|
||||
|
||||
Reference in new issue
Block a user