From 3736bf2d1cb0aa3aa747573a8987d0b30f0bf5b4 Mon Sep 17 00:00:00 2001 From: mertmit Date: Fri, 26 Jan 2024 21:38:13 +0000 Subject: [PATCH] refactor: replace getNestedUidt with getNestedColumn --- packages/nocodb/src/db/BaseModelSqlv2.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index 509ce1d58e..1774fa2e29 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -4720,7 +4720,7 @@ class BaseModelSqlv2 { if (col.uidt === UITypes.Lookup) { if ( [UITypes.User, UITypes.CreatedBy, UITypes.LastModifiedBy].includes( - (await this.getNestedUidt(col)) as UITypes, + (await this.getNestedColumn(col))?.uidt as UITypes, ) ) { userColumns.push(col); @@ -4870,12 +4870,12 @@ class BaseModelSqlv2 { return d; } - public async getNestedUidt(column: Column) { + public async getNestedColumn(column: Column) { if (column.uidt !== UITypes.Lookup) { - return column.uidt; + return column; } const colOptions = await column.getColOptions(); - return this.getNestedUidt(await colOptions?.getLookupColumn()); + return this.getNestedColumn(await colOptions?.getLookupColumn()); } public async convertAttachmentType( @@ -4897,7 +4897,7 @@ class BaseModelSqlv2 { for (const col of columns) { if (col.uidt === UITypes.Lookup) { - if ((await this.getNestedUidt(col)) === UITypes.Attachment) { + if ((await this.getNestedColumn(col))?.uidt === UITypes.Attachment) { attachmentColumns.push(col); } } else {