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) return table.columns.includes(col.column_name)
}) })
const tableMeta = await $api.dbTable.create(project?.value?.id as string, { try {
...table, const tableMeta = await $api.dbTable.create(project?.value?.id as string, {
columns, ...table,
}) columns,
})
onTableCreate?.(tableMeta) onTableCreate?.(tableMeta)
} catch (e: any) {
message.error(await extractSdkResponseErrorMsg(e))
return
}
} }
watch( watch(

Loading…
Cancel
Save