Browse Source

fix: pass values as array

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5901/head
Pranav C 1 year ago
parent
commit
8611b53a62
  1. 6
      packages/nocodb/src/db/BaseModelSqlv2.ts
  2. 4
      packages/nocodb/src/services/data-table.service.ts

6
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)

4
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,
});

Loading…
Cancel
Save