Browse Source

fix(gui-v2): add a try-catch for api call

pull/3117/head
Wing-Kam Wong 2 years ago
parent
commit
33c9f8e60f
  1. 16
      packages/nc-gui-v2/composables/useTable.ts

16
packages/nc-gui-v2/composables/useTable.ts

@ -31,12 +31,16 @@ export function useTable(onTableCreate?: (tableMeta: TableType) => void) {
return table.columns.includes(col.column_name)
})
const tableMeta = await $api.dbTable.create(project?.value?.id as string, {
...table,
columns,
})
onTableCreate?.(tableMeta)
try {
const tableMeta = await $api.dbTable.create(project?.value?.id as string, {
...table,
columns,
})
onTableCreate?.(tableMeta)
} catch (e: any) {
message.error(await extractSdkResponseErrorMsg(e))
return
}
}
watch(

Loading…
Cancel
Save