Skip to content

Commit 65b18d1

Browse files
committed
use reactquery
1 parent 8d9ceca commit 65b18d1

File tree

2 files changed

+1
-10
lines changed
  • apps/sim/app

2 files changed

+1
-10
lines changed

apps/sim/app/api/mcp/workflow-servers/route.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,10 @@ export const POST = withMcpAuth('write')(
131131
})
132132
.returning()
133133

134-
// If workflowIds are provided, create tools for each workflow
135134
const workflowIds: string[] = body.workflowIds || []
136135
const addedTools: Array<{ workflowId: string; toolName: string }> = []
137136

138137
if (workflowIds.length > 0) {
139-
// Fetch all workflows in one query
140138
const workflows = await db
141139
.select({
142140
id: workflow.id,
@@ -148,23 +146,19 @@ export const POST = withMcpAuth('write')(
148146
.from(workflow)
149147
.where(inArray(workflow.id, workflowIds))
150148

151-
// Create tools for each valid workflow
152149
for (const workflowRecord of workflows) {
153-
// Skip if workflow doesn't belong to this workspace
154150
if (workflowRecord.workspaceId !== workspaceId) {
155151
logger.warn(
156152
`[${requestId}] Skipping workflow ${workflowRecord.id} - does not belong to workspace`
157153
)
158154
continue
159155
}
160156

161-
// Skip if workflow is not deployed
162157
if (!workflowRecord.isDeployed) {
163158
logger.warn(`[${requestId}] Skipping workflow ${workflowRecord.id} - not deployed`)
164159
continue
165160
}
166161

167-
// Skip if workflow doesn't have a start block
168162
const hasStartBlock = await hasValidStartBlock(workflowRecord.id)
169163
if (!hasStartBlock) {
170164
logger.warn(`[${requestId}] Skipping workflow ${workflowRecord.id} - no start block`)

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/workflow-mcp-servers/workflow-mcp-servers.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ interface ServerDetailViewProps {
5959
type McpClientType = 'cursor' | 'claude-code' | 'claude-desktop' | 'vscode'
6060

6161
function ServerDetailView({ workspaceId, serverId, onBack }: ServerDetailViewProps) {
62-
const { data, isLoading, error, refetch } = useWorkflowMcpServer(workspaceId, serverId)
62+
const { data, isLoading, error } = useWorkflowMcpServer(workspaceId, serverId)
6363
const { data: deployedWorkflows = [], isLoading: isLoadingWorkflows } =
6464
useDeployedWorkflows(workspaceId)
6565
const deleteToolMutation = useDeleteWorkflowMcpTool()
@@ -146,7 +146,6 @@ function ServerDetailView({ workspaceId, serverId, onBack }: ServerDetailViewPro
146146
setShowAddWorkflow(false)
147147
setSelectedWorkflowId(null)
148148
setActiveServerTab('workflows')
149-
refetch()
150149
} catch (err) {
151150
logger.error('Failed to add workflow:', err)
152151
}
@@ -253,7 +252,6 @@ function ServerDetailView({ workspaceId, serverId, onBack }: ServerDetailViewPro
253252
isPublic: editServerIsPublic,
254253
})
255254
setShowEditServer(false)
256-
refetch()
257255
} catch (err) {
258256
logger.error('Failed to update server:', err)
259257
}
@@ -676,7 +674,6 @@ function ServerDetailView({ workspaceId, serverId, onBack }: ServerDetailViewPro
676674
toolDescription: editingDescription.trim() || undefined,
677675
parameterSchema: updatedSchema,
678676
})
679-
refetch()
680677
setToolToView(null)
681678
setEditingDescription('')
682679
setEditingParameterDescriptions({})

0 commit comments

Comments
 (0)