MCPcopy Index your code
hub / github.com/simstudioai/sim / useUndeployWorkflow

Function useUndeployWorkflow

apps/sim/hooks/queries/deployments.ts:325–348  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

323 * Invalidates deployment info and versions queries on success.
324 */
325export function useUndeployWorkflow() {
326 const queryClient = useQueryClient()
327
328 return useMutation({
329 mutationFn: async ({ workflowId }: UndeployWorkflowVariables) => {
330 return requestJson(undeployWorkflowContract, {
331 params: { id: workflowId },
332 })
333 },
334 onSettled: (_data, error, variables) => {
335 if (error) {
336 logger.error('Failed to undeploy workflow', { error })
337 } else {
338 logger.info('Workflow undeployed successfully', { workflowId: variables.workflowId })
339 }
340 return Promise.all([
341 invalidateDeploymentQueries(queryClient, variables.workflowId),
342 queryClient.invalidateQueries({
343 queryKey: deploymentKeys.chatStatus(variables.workflowId),
344 }),
345 ])
346 },
347 })
348}
349
350/**
351 * Variables for update deployment version mutation

Callers 1

DeployModalFunction · 0.90

Calls 4

requestJsonFunction · 0.90
errorMethod · 0.80
infoMethod · 0.80

Tested by

no test coverage detected