diff --git a/packages/nc-gui-v2/components/webhook/Editor.vue b/packages/nc-gui-v2/components/webhook/Editor.vue index 9c464210be..6f8d62e4d4 100644 --- a/packages/nc-gui-v2/components/webhook/Editor.vue +++ b/packages/nc-gui-v2/components/webhook/Editor.vue @@ -36,9 +36,22 @@ const hook = reactive({ type: 'URL', channels: '', }, - method: 'GET', + api: { + method: 'POST', + path: '', + body: '{{ json data }}', + params: [], + auth: '', + headers: [], + response: {}, + perf: {}, + meta: {}, + }, + condition: false, }) +const urlTabKey = ref('body') + const apps: Record = ref() const slackChannels = ref() @@ -145,7 +158,17 @@ const formInput = ref({ ], }) -const notification = ref({}) +const notification = ref({ + method: 'GET', + path: '', + body: '', + params: [], + auth: '', + headers: [], + response: {}, + perf: {}, + meta: {}, +}) const eventList = ref([ { @@ -187,7 +210,8 @@ const validators = computed(() => { 'title': [fieldRequiredValidator], 'event': [fieldRequiredValidator], 'notification.type': [fieldRequiredValidator], - 'notification.url': [fieldRequiredValidator], + 'api.method': [fieldRequiredValidator], + 'api.path': [fieldRequiredValidator], 'notification.channels': [fieldRequiredValidator], 'method': [fieldRequiredValidator], } @@ -195,7 +219,17 @@ const validators = computed(() => { const { resetFields, validate, validateInfos } = useForm(hook, validators) function onNotTypeChange() { - notification.value = {} + notification.value = { + method: 'GET', + path: '', + body: '', + params: [], + auth: '', + headers: [], + response: {}, + perf: {}, + meta: {}, + } if (hook.notification.type === 'Slack') { slackChannels.value = (apps && apps?.Slack && apps.Slack.parsedInput) || [] @@ -305,16 +339,33 @@ onMounted(() => { - + {{ method.title }} - - + + - + + + + + + + + + + + + + + + + + +