Browse Source

refactor: replace getNestedUidt with getNestedColumn

pull/7508/head
mertmit 10 months ago
parent
commit
3736bf2d1c
  1. 10
      packages/nocodb/src/db/BaseModelSqlv2.ts

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

@ -4720,7 +4720,7 @@ class BaseModelSqlv2 {
if (col.uidt === UITypes.Lookup) { if (col.uidt === UITypes.Lookup) {
if ( if (
[UITypes.User, UITypes.CreatedBy, UITypes.LastModifiedBy].includes( [UITypes.User, UITypes.CreatedBy, UITypes.LastModifiedBy].includes(
(await this.getNestedUidt(col)) as UITypes, (await this.getNestedColumn(col))?.uidt as UITypes,
) )
) { ) {
userColumns.push(col); userColumns.push(col);
@ -4870,12 +4870,12 @@ class BaseModelSqlv2 {
return d; return d;
} }
public async getNestedUidt(column: Column) { public async getNestedColumn(column: Column) {
if (column.uidt !== UITypes.Lookup) { if (column.uidt !== UITypes.Lookup) {
return column.uidt; return column;
} }
const colOptions = await column.getColOptions<LookupColumn>(); const colOptions = await column.getColOptions<LookupColumn>();
return this.getNestedUidt(await colOptions?.getLookupColumn()); return this.getNestedColumn(await colOptions?.getLookupColumn());
} }
public async convertAttachmentType( public async convertAttachmentType(
@ -4897,7 +4897,7 @@ class BaseModelSqlv2 {
for (const col of columns) { for (const col of columns) {
if (col.uidt === UITypes.Lookup) { if (col.uidt === UITypes.Lookup) {
if ((await this.getNestedUidt(col)) === UITypes.Attachment) { if ((await this.getNestedColumn(col))?.uidt === UITypes.Attachment) {
attachmentColumns.push(col); attachmentColumns.push(col);
} }
} else { } else {

Loading…
Cancel
Save