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. 5
      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() {
loading.value = true
await templateEditorRef.value.importTemplate()
loading.value = false
try {
loading.value = true
await templateEditorRef.value.importTemplate()
} catch (e: any) {
return toast.error(await extractSdkResponseErrorMsg(e))
} finally {
loading.value = false
}
dialogShow.value = false
}

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

@ -174,9 +174,8 @@ async function importTemplate() {
try {
await validate()
} catch (errorInfo) {
toast.error('Please fill all the required values')
isImporting.value = false
return
throw new Error('Please fill all the required values')
}
try {
@ -477,4 +476,4 @@ defineExpose({
@apply !pb-0;
}
}
</style>
</style>

Loading…
Cancel
Save