Browse Source

fix(gui-v2): fix json validation logic

pull/2885/head
Wing-Kam Wong 2 years ago
parent
commit
9c4594ef34
  1. 11
      packages/nc-gui-v2/components/dlg/QuickImport.vue
  2. 3
      packages/nc-gui-v2/components/template/Editor.vue

11
packages/nc-gui-v2/components/dlg/QuickImport.vue

@ -141,9 +141,14 @@ async function handlePreImport() {
} }
async function handleImport() { async function handleImport() {
loading.value = true try {
await templateEditorRef.value.importTemplate() loading.value = true
loading.value = false await templateEditorRef.value.importTemplate()
} catch (e: any) {
return toast.error(await extractSdkResponseErrorMsg(e))
} finally {
loading.value = false
}
dialogShow.value = false dialogShow.value = false
} }

3
packages/nc-gui-v2/components/template/Editor.vue

@ -174,9 +174,8 @@ async function importTemplate() {
try { try {
await validate() await validate()
} catch (errorInfo) { } catch (errorInfo) {
toast.error('Please fill all the required values')
isImporting.value = false isImporting.value = false
return throw new Error('Please fill all the required values')
} }
try { try {

Loading…
Cancel
Save