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. 6
      packages/nc-gui-v2/composables/useTable.ts

6
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)
})
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