parent
1367f095d4
commit
96dfedde6e
|
|
@ -155,7 +155,7 @@ export default function FlowListMenu({ chatflow, isAgentCanvas, setError, update
|
|||
await updateChatflowApi.request(chatflow.id, updateBody)
|
||||
await updateFlowsApi.request()
|
||||
} catch (error) {
|
||||
setError(error)
|
||||
if (setError) setError(error)
|
||||
enqueueSnackbar({
|
||||
message: typeof error.response.data === 'object' ? error.response.data.message : error.response.data,
|
||||
options: {
|
||||
|
|
@ -194,7 +194,7 @@ export default function FlowListMenu({ chatflow, isAgentCanvas, setError, update
|
|||
await updateChatflowApi.request(chatflow.id, updateBody)
|
||||
await updateFlowsApi.request()
|
||||
} catch (error) {
|
||||
setError(error)
|
||||
if (setError) setError(error)
|
||||
enqueueSnackbar({
|
||||
message: typeof error.response.data === 'object' ? error.response.data.message : error.response.data,
|
||||
options: {
|
||||
|
|
@ -226,7 +226,7 @@ export default function FlowListMenu({ chatflow, isAgentCanvas, setError, update
|
|||
await chatflowsApi.deleteChatflow(chatflow.id)
|
||||
await updateFlowsApi.request()
|
||||
} catch (error) {
|
||||
setError(error)
|
||||
if (setError) setError(error)
|
||||
enqueueSnackbar({
|
||||
message: typeof error.response.data === 'object' ? error.response.data.message : error.response.data,
|
||||
options: {
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ const APIKeyDialog = ({ show, dialogProps, onCancel, onConfirm, setError }) => {
|
|||
onConfirm()
|
||||
}
|
||||
} catch (error) {
|
||||
setError(error)
|
||||
if (setError) setError(error)
|
||||
enqueueSnackbar({
|
||||
message: `Failed to add new API key: ${
|
||||
typeof error.response.data === 'object' ? error.response.data.message : error.response.data
|
||||
|
|
@ -116,7 +116,7 @@ const APIKeyDialog = ({ show, dialogProps, onCancel, onConfirm, setError }) => {
|
|||
onConfirm()
|
||||
}
|
||||
} catch (error) {
|
||||
setError(error)
|
||||
if (setError) setError(error)
|
||||
enqueueSnackbar({
|
||||
message: `Failed to save API key: ${
|
||||
typeof error.response.data === 'object' ? error.response.data.message : error.response.data
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ const AssistantVectorStoreDialog = ({ show, dialogProps, onCancel, onConfirm, on
|
|||
}, [listAssistantVectorStoreApi.data])
|
||||
|
||||
useEffect(() => {
|
||||
if (getAssistantVectorStoreApi.error) {
|
||||
if (getAssistantVectorStoreApi.error && setError) {
|
||||
setError(getAssistantVectorStoreApi.error)
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
|
@ -152,7 +152,7 @@ const AssistantVectorStoreDialog = ({ show, dialogProps, onCancel, onConfirm, on
|
|||
}
|
||||
setLoading(false)
|
||||
} catch (error) {
|
||||
setError(error)
|
||||
if (setError) setError(error)
|
||||
enqueueSnackbar({
|
||||
message: `Failed to delete Vector Store: ${
|
||||
typeof error.response.data === 'object' ? error.response.data.message : error.response.data
|
||||
|
|
@ -198,7 +198,7 @@ const AssistantVectorStoreDialog = ({ show, dialogProps, onCancel, onConfirm, on
|
|||
}
|
||||
setLoading(false)
|
||||
} catch (error) {
|
||||
setError(error)
|
||||
if (setError) setError(error)
|
||||
enqueueSnackbar({
|
||||
message: `Failed to add new Vector Store: ${
|
||||
typeof error.response.data === 'object' ? error.response.data.message : error.response.data
|
||||
|
|
@ -249,8 +249,7 @@ const AssistantVectorStoreDialog = ({ show, dialogProps, onCancel, onConfirm, on
|
|||
}
|
||||
setLoading(false)
|
||||
} catch (error) {
|
||||
console.error('error=', error)
|
||||
setError(error)
|
||||
if (setError) setError(error)
|
||||
enqueueSnackbar({
|
||||
message: `Failed to save Vector Store: ${
|
||||
typeof error.response.data === 'object' ? error.response.data.message : error.response.data
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ const LoadAssistantDialog = ({ show, dialogProps, onCancel, onAssistantSelected,
|
|||
}, [getAllAvailableAssistantsApi.data])
|
||||
|
||||
useEffect(() => {
|
||||
if (getAllAvailableAssistantsApi.error) {
|
||||
if (getAllAvailableAssistantsApi.error && setError) {
|
||||
setError(getAllAvailableAssistantsApi.error)
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
|
|
|||
|
|
@ -71,14 +71,14 @@ const AddEditCredentialDialog = ({ show, dialogProps, onCancel, onConfirm, setEr
|
|||
}, [getSpecificComponentCredentialApi.data])
|
||||
|
||||
useEffect(() => {
|
||||
if (getSpecificCredentialApi.error) {
|
||||
if (getSpecificCredentialApi.error && setError) {
|
||||
setError(getSpecificCredentialApi.error)
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [getSpecificCredentialApi.error])
|
||||
|
||||
useEffect(() => {
|
||||
if (getSpecificComponentCredentialApi.error) {
|
||||
if (getSpecificComponentCredentialApi.error && setError) {
|
||||
setError(getSpecificComponentCredentialApi.error)
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
|
@ -132,7 +132,7 @@ const AddEditCredentialDialog = ({ show, dialogProps, onCancel, onConfirm, setEr
|
|||
onConfirm(createResp.data.id)
|
||||
}
|
||||
} catch (error) {
|
||||
setError(error)
|
||||
if (setError) setError(error)
|
||||
enqueueSnackbar({
|
||||
message: `Failed to add new Credential: ${
|
||||
typeof error.response.data === 'object' ? error.response.data.message : error.response.data
|
||||
|
|
@ -184,7 +184,7 @@ const AddEditCredentialDialog = ({ show, dialogProps, onCancel, onConfirm, setEr
|
|||
onConfirm(saveResp.data.id)
|
||||
}
|
||||
} catch (error) {
|
||||
setError(error)
|
||||
if (setError) setError(error)
|
||||
enqueueSnackbar({
|
||||
message: `Failed to save Credential: ${
|
||||
typeof error.response.data === 'object' ? error.response.data.message : error.response.data
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ const ToolDialog = ({ show, dialogProps, onUseTemplate, onCancel, onConfirm, set
|
|||
}, [getSpecificToolApi.data])
|
||||
|
||||
useEffect(() => {
|
||||
if (getSpecificToolApi.error) {
|
||||
if (getSpecificToolApi.error && setError) {
|
||||
setError(getSpecificToolApi.error)
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ const AddEditVariableDialog = ({ show, dialogProps, onCancel, onConfirm, setErro
|
|||
onConfirm(createResp.data.id)
|
||||
}
|
||||
} catch (err) {
|
||||
setError(err)
|
||||
if (setError) setError(err)
|
||||
enqueueSnackbar({
|
||||
message: `Failed to add new Variable: ${
|
||||
typeof error.response.data === 'object' ? error.response.data.message : error.response.data
|
||||
|
|
@ -156,7 +156,7 @@ const AddEditVariableDialog = ({ show, dialogProps, onCancel, onConfirm, setErro
|
|||
onConfirm(saveResp.data.id)
|
||||
}
|
||||
} catch (error) {
|
||||
setError(err)
|
||||
if (setError) setError(err)
|
||||
enqueueSnackbar({
|
||||
message: `Failed to save Variable: ${
|
||||
typeof error.response.data === 'object' ? error.response.data.message : error.response.data
|
||||
|
|
|
|||
Loading…
Reference in New Issue