diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index c324f796a1..e73528f4fe 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -3491,7 +3491,7 @@ class BaseModelSqlv2 { rowId, }: { cookie: any; - childIds: (string|number)[]; + childIds: (string | number)[]; colId: string; rowId: string; }) { @@ -3599,7 +3599,7 @@ class BaseModelSqlv2 { rowId, }: { cookie: any; - childIds: (string|number)[]; + childIds: (string | number)[]; colId: string; rowId: string; }) { @@ -3636,7 +3636,7 @@ class BaseModelSqlv2 { .where({ [vParentCol.column_name]: this.dbDriver(parentTn) .select(parentColumn.column_name) - .whereIn(parentTable.primaryKey.column_name,childIds) + .whereIn(parentTable.primaryKey.column_name, childIds) .first(), [vChildCol.column_name]: this.dbDriver(childTn) .select(childColumn.column_name) diff --git a/packages/nocodb/src/services/data-table.service.ts b/packages/nocodb/src/services/data-table.service.ts index ddfb72efde..be733a49a5 100644 --- a/packages/nocodb/src/services/data-table.service.ts +++ b/packages/nocodb/src/services/data-table.service.ts @@ -317,7 +317,7 @@ export class DataTableService { await baseModel.addLinks({ colId: column.id, - childIds: param.refRowIds, + childIds: Array.isArray(param.refRowIds) ? param.refRowIds : [param.refRowIds], rowId: param.rowId, cookie: param.cookie, }); @@ -340,7 +340,7 @@ export class DataTableService { await baseModel.removeLinks({ colId: column.id, - childIds: param.refRowIds, + childIds: Array.isArray(param.refRowIds) ? param.refRowIds : [param.refRowIds], rowId: param.rowId, cookie: param.cookie, });