File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
apps/sim/app/api/workflows/[id]
deployments/[version]/revert Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { getAuditActorMetadata } from '@/lib/audit/actor-metadata'
66import { AuditAction , AuditResourceType , recordAudit } from '@/lib/audit/log'
77import { env } from '@/lib/core/config/env'
88import { generateRequestId } from '@/lib/core/utils/request'
9+ import { syncMcpToolsForWorkflow } from '@/lib/mcp/workflow-mcp-sync'
910import { saveWorkflowToNormalizedTables } from '@/lib/workflows/persistence/utils'
1011import { validateWorkflowAccess } from '@/app/api/workflows/middleware'
1112import { createErrorResponse , createSuccessResponse } from '@/app/api/workflows/utils'
@@ -101,6 +102,13 @@ export async function POST(
101102 . set ( { lastSynced : new Date ( ) , updatedAt : new Date ( ) } )
102103 . where ( eq ( workflow . id , id ) )
103104
105+ await syncMcpToolsForWorkflow ( {
106+ workflowId : id ,
107+ requestId,
108+ state : deployedState ,
109+ context : 'revert' ,
110+ } )
111+
104112 try {
105113 const socketServerUrl = env . SOCKET_SERVER_URL || 'http://localhost:3002'
106114 await fetch ( `${ socketServerUrl } /api/workflow-reverted` , {
Original file line number Diff line number Diff line change @@ -406,9 +406,6 @@ describe('Workflow By ID API Route', () => {
406406 where : vi . fn ( ) . mockResolvedValue ( [ { id : 'workflow-123' } , { id : 'workflow-456' } ] ) ,
407407 } ) ,
408408 } )
409- mockDbDelete . mockReturnValue ( {
410- where : vi . fn ( ) . mockResolvedValue ( [ { id : 'workflow-123' } ] ) ,
411- } )
412409 setupGlobalFetchMock ( { ok : true } )
413410
414411 const req = new NextRequest ( 'http://localhost:3000/api/workflows/workflow-123' , {
You can’t perform that action at this time.
0 commit comments