Skip to content

Commit

Permalink
refactor(gateway): ssl data when update gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinplemelon committed May 16, 2022
1 parent 934ff02 commit 610cc36
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/views/Gateway/components/basic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ import ExprotoBasic from './exprotoBasic.vue'
import { updateGateway, getGateway } from '@/api/gateway'
import { useI18n } from 'vue-i18n'
import { useRoute } from 'vue-router'
import useHandleExprotoData from '@/hooks/Gateway/useHandleExprotoData.ts'
import { GatewayName } from '@/types/enum'
export default defineComponent({
components: { stompBasic, MqttsnBasic, Lwm2mBasic, CoapBasic, ExprotoBasic },
Expand Down Expand Up @@ -65,6 +67,7 @@ export default defineComponent({
}
}
const { handleExprotoData } = useHandleExprotoData()
const updateGatewayInfo = async function () {
updateLoading.value = true
infoLoading.value = true
Expand All @@ -80,7 +83,11 @@ export default defineComponent({
delete basicData.value[field]
})
try {
await updateGateway(name, basicData.value)
let dataToSubmit = basicData.value
if (name === GatewayName.ExProto) {
dataToSubmit = handleExprotoData(dataToSubmit)
}
await updateGateway(name, dataToSubmit)
this.$message({
type: 'success',
message: t('Base.updateSuccess'),
Expand Down

0 comments on commit 610cc36

Please sign in to comment.