Browse Source

fix(gui-v2): handle base cases

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

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

@ -232,6 +232,8 @@ function onNotTypeChange() {
} }
if (hook.notification.type === 'URL') { if (hook.notification.type === 'URL') {
hook.notification.payload.body = '{{ json data }}' hook.notification.payload.body = '{{ json data }}'
hook.notification.payload.parameters = [{}]
hook.notification.payload.headers = [{}]
} }
} }
@ -289,6 +291,8 @@ async function onEventChange() {
if (hook.notification.type === 'URL') { if (hook.notification.type === 'URL') {
hook.notification.payload = hook.notification.payload || {} hook.notification.payload = hook.notification.payload || {}
hook.notification.payload.parameters = hook.notification.payload.parameters || [{}]
hook.notification.payload.headers = hook.notification.payload.headers || [{}]
} }
} }
@ -344,7 +348,7 @@ async function saveHooks() {
} }
if (!hook.id && res) { if (!hook.id && res) {
// hook.id = res.id hook.id = res.id
} }
// TODO: wait for filter implementation // TODO: wait for filter implementation
@ -591,8 +595,7 @@ onMounted(() => {
filters, filters,
notification: { notification: {
...hook.notification, ...hook.notification,
// FIXME: this should be wrong payload: hook.notification.payload,
payload: notification,
}, },
}" }"
/> />

Loading…
Cancel
Save