MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / handleDeleteFlow

Function handleDeleteFlow

packages/ui/src/views/canvas/index.jsx:179–209  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

177 }
178
179 const handleDeleteFlow = async () => {
180 const confirmPayload = {
181 title: `Delete`,
182 description: `Delete ${canvasTitle} ${chatflow.name}?`,
183 confirmButtonName: 'Delete',
184 cancelButtonName: 'Cancel'
185 }
186 const isConfirmed = await confirm(confirmPayload)
187
188 if (isConfirmed) {
189 try {
190 await chatflowsApi.deleteChatflow(chatflow.id)
191 localStorage.removeItem(`${chatflow.id}_INTERNAL`)
192 navigate(isAgentCanvas ? '/agentflows' : '/')
193 } catch (error) {
194 enqueueSnackbar({
195 message: typeof error.response.data === 'object' ? error.response.data.message : error.response.data,
196 options: {
197 key: new Date().getTime() + Math.random(),
198 variant: 'error',
199 persist: true,
200 action: (key) => (
201 <Button style={{ color: 'white' }} onClick={() => closeSnackbar(key)}>
202 <IconX />
203 </Button>
204 )
205 }
206 })
207 }
208 }
209 }
210
211 const handleSaveFlow = async (chatflowName) => {
212 if (reactFlowInstance) {

Callers 1

onSettingsItemClickFunction · 0.70

Calls 4

enqueueSnackbarFunction · 0.90
closeSnackbarFunction · 0.90
confirmFunction · 0.85
getTimeMethod · 0.45

Tested by

no test coverage detected