Browse Source

fix(nc-gui): add ColumnType

pull/5307/head
Wing-Kam Wong 2 years ago
parent
commit
48688737c1
  1. 6
      packages/nc-gui/composables/useTable.ts

6
packages/nc-gui/composables/useTable.ts

@ -1,4 +1,4 @@
import type { LinkToAnotherRecordType, TableType } from 'nocodb-sdk' import type { ColumnType, LinkToAnotherRecordType, TableType } from 'nocodb-sdk'
import { UITypes, isSystemColumn } from 'nocodb-sdk' import { UITypes, isSystemColumn } from 'nocodb-sdk'
import { import {
Modal, Modal,
@ -40,14 +40,14 @@ export function useTable(onTableCreate?: (tableMeta: TableType) => void, baseId?
const createTable = async () => { const createTable = async () => {
if (!sqlUi?.value) return if (!sqlUi?.value) return
const columns = sqlUi?.value?.getNewTableColumns().filter((col) => { const columns = sqlUi?.value?.getNewTableColumns().filter((col: ColumnType) => {
if (col.column_name === 'id' && table.columns.includes('id_ag')) { if (col.column_name === 'id' && table.columns.includes('id_ag')) {
Object.assign(col, sqlUi?.value?.getDataTypeForUiType({ uidt: UITypes.ID }, 'AG')) Object.assign(col, sqlUi?.value?.getDataTypeForUiType({ uidt: UITypes.ID }, 'AG'))
col.dtxp = sqlUi?.value?.getDefaultLengthForDatatype(col.dt) col.dtxp = sqlUi?.value?.getDefaultLengthForDatatype(col.dt)
col.dtxs = sqlUi?.value?.getDefaultScaleForDatatype(col.dt) col.dtxs = sqlUi?.value?.getDefaultScaleForDatatype(col.dt)
return true return true
} }
return table.columns.includes(col.column_name) return table.columns.includes(col.column_name!)
}) })
try { try {

Loading…
Cancel
Save