Browse Source

fix(gui-v2): payload body issue

pull/2838/head
Wing-Kam Wong 2 years ago
parent
commit
b42238f7ac
  1. 18
      packages/nc-gui-v2/components/webhook/Editor.vue

18
packages/nc-gui-v2/components/webhook/Editor.vue

@ -217,17 +217,7 @@ const validators = computed(() => {
const { resetFields, validate, validateInfos } = useForm(hook, validators)
function onNotTypeChange() {
const notification = {
method: 'GET',
path: '',
body: '',
params: [],
auth: '',
headers: [],
response: {},
perf: {},
meta: {},
}
hook.notification.payload = {} as any
if (hook.notification.type === 'Slack') {
slackChannels.value = (apps && apps?.Slack && apps.Slack.parsedInput) || []
@ -242,7 +232,6 @@ function onNotTypeChange() {
mattermostChannels.value = (apps && apps.Mattermost && apps.Mattermost.parsedInput) || []
}
if (hook.notification.type === 'URL') {
hook.notification = hook.notification ?? notification
hook.notification.payload.body = '{{ json data }}'
}
}
@ -272,8 +261,6 @@ async function onEventChange() {
},
})
await onNotTypeChange()
hook.notification.payload = payload
let channels: Record<string, any>[] | null = null
@ -303,7 +290,6 @@ async function onEventChange() {
if (hook.notification.type === 'URL') {
hook.notification.payload = hook.notification.payload || {}
hook.notification.payload.body = '{{ json data }}'
}
}
@ -617,4 +603,4 @@ onMounted(() => {
</a-row>
</a-form-item>
</a-form>
</template>
</template>
Loading…
Cancel
Save