diff --git a/src/hooks/Rule/connector/useComponentsHandlers.ts b/src/hooks/Rule/connector/useComponentsHandlers.ts index 3c92e8251..42d3e5773 100644 --- a/src/hooks/Rule/connector/useComponentsHandlers.ts +++ b/src/hooks/Rule/connector/useComponentsHandlers.ts @@ -136,7 +136,7 @@ export default ( } } const i18nPrefix = getI18nPrefix(BridgeType.MQTT) - if (comRet?.static_clientids.items.properties) { + if (comRet?.static_clientids?.items?.properties) { const props = comRet.static_clientids.items.properties if (props.ids) { setLabelAndDesc(props.ids, `${i18nPrefix}ids`) diff --git a/src/hooks/Webhook/useWebhookItem.ts b/src/hooks/Webhook/useWebhookItem.ts index 5ff083760..943bd1636 100644 --- a/src/hooks/Webhook/useWebhookItem.ts +++ b/src/hooks/Webhook/useWebhookItem.ts @@ -1,5 +1,5 @@ import { deleteAction, putActionEnable } from '@/api/action' -import { deleteConnector } from '@/api/connector' +import { deleteConnector, putConnectorEnable } from '@/api/connector' import { deleteRules, updateRules } from '@/api/ruleengine' import { WebhookItem } from '@/types/webhook' import { ElMessage as M, ElMessageBox as MB } from 'element-plus' @@ -8,7 +8,7 @@ import { ref } from 'vue' import { useI18n } from 'vue-i18n' export default (): { - toggleWebhookEnableStatus: (webhook: WebhookItem) => Promise<[any, any]> + toggleWebhookEnableStatus: (webhook: WebhookItem) => Promise<[any, any, any]> deleteLoading: Ref deleteWebhook: (webhook: WebhookItem) => Promise } => { @@ -23,6 +23,7 @@ export default (): { return await Promise.all([ toggleBridgeEnableStatus(webhook.action.id, enable), toggleRuleEnableStatus(webhook.rule.id, enable), + putConnectorEnable(webhook.connector.id, enable), ]) }