From 8349a71721f6722fa1250954ecc9b8375061db07 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sun, 18 Jun 2023 03:12:38 +0530 Subject: [PATCH] fix: add link support to nested insert Signed-off-by: Pranav C --- packages/nocodb/src/db/BaseModelSqlv2.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index 077bec27ba..cf56ced0ad 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -18,6 +18,7 @@ import { customAlphabet } from 'nanoid'; import DOMPurify from 'isomorphic-dompurify'; import { v4 as uuidv4 } from 'uuid'; import { Knex } from 'knex'; +import { isLinksOrLTAR } from '../../../nocodb-sdk/src'; import { NcError } from '../helpers/catchError'; import getAst from '../helpers/getAst'; import { @@ -2123,8 +2124,8 @@ class BaseModelSqlv2 { let rowId = null; const postInsertOps = []; - const nestedCols = (await this.model.getColumns()).filter( - (c) => c.uidt === UITypes.LinkToAnotherRecord, + const nestedCols = (await this.model.getColumns()).filter((c) => + isLinksOrLTAR(c), ); for (const col of nestedCols) {