Browse Source

fix(nc-gui): webhook test types

pull/5307/head
Wing-Kam Wong 2 years ago
parent
commit
fedc4fcd7a
  1. 14
      packages/nc-gui/components/webhook/Test.vue

14
packages/nc-gui/components/webhook/Test.vue

@ -1,8 +1,9 @@
<script setup lang="ts"> <script setup lang="ts">
import type { HookTestReqType, HookType } from 'nocodb-sdk'
import { MetaInj, extractSdkResponseErrorMsg, inject, message, onMounted, ref, useI18n, useNuxtApp, watch } from '#imports' import { MetaInj, extractSdkResponseErrorMsg, inject, message, onMounted, ref, useI18n, useNuxtApp, watch } from '#imports'
interface Props { interface Props {
hook: Record<string, any> hook: HookType
} }
const { hook } = defineProps<Props>() const { hook } = defineProps<Props>()
@ -33,10 +34,13 @@ async function loadSampleData() {
async function testWebhook() { async function testWebhook() {
try { try {
await $api.dbTableWebhook.test(meta.value?.id as string, { await $api.dbTableWebhook.test(
hook, meta.value?.id as string,
payload: sampleData.value, {
}) hook,
payload: sampleData.value,
} as HookTestReqType,
)
// Webhook tested successfully // Webhook tested successfully
message.success(t('msg.success.webhookTested')) message.success(t('msg.success.webhookTested'))

Loading…
Cancel
Save