Browse Source

fix(nc-gui): set eventList when the hook is ready

pull/5349/head
Wing-Kam Wong 2 years ago
parent
commit
ef9d1f3b5a
  1. 26
      packages/nc-gui/components/webhook/Editor.vue

26
packages/nc-gui/components/webhook/Editor.vue

@ -175,18 +175,7 @@ const formInput = ref({
], ],
}) })
const eventList = [ const eventList = ref<Record<string, any>[]>([])
{ text: ['After', 'Insert'], value: ['after', 'insert'] },
{ text: ['After', 'Update'], value: ['after', 'update'] },
{ text: ['After', 'Delete'], value: ['after', 'delete'] },
...(hook.version === 'v2'
? [
{ text: ['After', 'Bulk Insert'], value: ['after', 'bulkInsert'] },
{ text: ['After', 'Bulk Update'], value: ['after', 'bulkUpdate'] },
{ text: ['After', 'Bulk Delete'], value: ['after', 'bulkDelete'] },
]
: []),
]
const notificationList = computed(() => { const notificationList = computed(() => {
return appInfo.isCloud return appInfo.isCloud
@ -283,6 +272,19 @@ function setHook(newHook: HookType) {
if (hook.version === 'v1') { if (hook.version === 'v1') {
urlTabKey.value = 'body' urlTabKey.value = 'body'
} }
eventList.value = [
{ text: ['After', 'Insert'], value: ['after', 'insert'] },
{ text: ['After', 'Update'], value: ['after', 'update'] },
{ text: ['After', 'Delete'], value: ['after', 'delete'] },
...(hook.version === 'v2'
? [
{ text: ['After', 'Bulk Insert'], value: ['after', 'bulkInsert'] },
{ text: ['After', 'Bulk Update'], value: ['after', 'bulkUpdate'] },
{ text: ['After', 'Bulk Delete'], value: ['after', 'bulkDelete'] },
]
: []),
]
} }
async function onEventChange() { async function onEventChange() {

Loading…
Cancel
Save