diff --git a/packages/nc-gui-v2/components/smartsheet/Form.vue b/packages/nc-gui-v2/components/smartsheet/Form.vue index 83e92a2ca7..f07359436a 100644 --- a/packages/nc-gui-v2/components/smartsheet/Form.vue +++ b/packages/nc-gui-v2/components/smartsheet/Form.vue @@ -20,10 +20,10 @@ const { isUIAllowed } = useUIPermission() const formState = reactive({ heading: '', subheading: '', - submitAnotherForm: false, - showBlankForm: false, - emailMe: false, - successMsg: '', + submit_another_form: false, + show_blank_form: false, + email: false, + success_msg: '', }) const isEditable = isUIAllowed('editFormView' as Permission) @@ -56,14 +56,35 @@ async function removeAllColumns() {} async function checkSMTPStatus() {} +function setFormData() { + Object.assign(formState, { + heading: formData.value?.heading, + subheading: formData.value?.subheading, + submit_another_form: !!formData.value?.submit_another_form, + show_blank_form: !!formData.value?.email, + email: formData.value?.submit_another_form, + success_msg: formData.value?.success_msg, + }) +} + onMounted(async () => { await loadFormData() + setFormData() }) + +// TODO: check if it's required +watch( + () => formData, + (v) => { + setFormData() + }, +)