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

Function handleDeleteFlow

packages/ui/src/views/agentflowsv2/Canvas.jsx:187–217  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected