From 7a842cd033f02def8daf890f2cfedd1b786b24bd Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Wed, 27 Jul 2022 18:11:00 +0800 Subject: [PATCH] feat(gui-v2): editHook --- packages/nc-gui-v2/components/webhook/Drawer.vue | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/nc-gui-v2/components/webhook/Drawer.vue b/packages/nc-gui-v2/components/webhook/Drawer.vue index bd14e77d70..2c8462810d 100644 --- a/packages/nc-gui-v2/components/webhook/Drawer.vue +++ b/packages/nc-gui-v2/components/webhook/Drawer.vue @@ -8,24 +8,29 @@ const emit = defineEmits(['update:modelValue']) const editOrAdd = ref(false) +const webhookEditorRef = ref() + const dialogShow = computed({ get() { return modelValue }, - set(v) { + set(v: boolean) { emit('update:modelValue', v) }, }) -function editHook(hook: Record) { +async function editHook(hook: Record) { editOrAdd.value = true - // TODO: update editor ref hook + nextTick(async () => { + webhookEditorRef.value.hook = { ...hook } + await webhookEditorRef.value.onEventChange() + }) }