Browse Source

fix: extract column list if missing

pull/7304/head
Pranav C 12 months ago
parent
commit
2f17136e26
  1. 8
      packages/nocodb/src/db/BaseModelSqlv2.ts

8
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -101,7 +101,11 @@ function checkColumnRequired(
return !fields || fields.includes(column.title); return !fields || fields.includes(column.title);
} }
export function getColumnName(column: Column<any>, columns: Column[] = []) { export async function getColumnName(
column: Column<any>,
columns?: Column[] = [],
) {
columns = columns || (await Column.list({ fk_model_id: column.fk_model_id }));
switch (column.uidt) { switch (column.uidt) {
case UITypes.CreatedTime: { case UITypes.CreatedTime: {
const createdTimeSystemCol = columns.find( const createdTimeSystemCol = columns.find(
@ -2139,7 +2143,7 @@ class BaseModelSqlv2 {
case UITypes.LastModifiedTime: case UITypes.LastModifiedTime:
case UITypes.DateTime: case UITypes.DateTime:
{ {
const columnName = getColumnName( const columnName = await getColumnName(
column, column,
await this.model.getColumns(), await this.model.getColumns(),
); );

Loading…
Cancel
Save