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, rowId,
}: { }: {
cookie: any; cookie: any;
childIds: (string|number)[]; childIds: (string | number)[];
colId: string; colId: string;
rowId: string; rowId: string;
}) { }) {
@ -3599,7 +3599,7 @@ class BaseModelSqlv2 {
rowId, rowId,
}: { }: {
cookie: any; cookie: any;
childIds: (string|number)[]; childIds: (string | number)[];
colId: string; colId: string;
rowId: string; rowId: string;
}) { }) {
@ -3636,7 +3636,7 @@ class BaseModelSqlv2 {
.where({ .where({
[vParentCol.column_name]: this.dbDriver(parentTn) [vParentCol.column_name]: this.dbDriver(parentTn)
.select(parentColumn.column_name) .select(parentColumn.column_name)
.whereIn(parentTable.primaryKey.column_name,childIds) .whereIn(parentTable.primaryKey.column_name, childIds)
.first(), .first(),
[vChildCol.column_name]: this.dbDriver(childTn) [vChildCol.column_name]: this.dbDriver(childTn)
.select(childColumn.column_name) .select(childColumn.column_name)

4
packages/nocodb/src/services/data-table.service.ts

@ -317,7 +317,7 @@ export class DataTableService {
await baseModel.addLinks({ await baseModel.addLinks({
colId: column.id, colId: column.id,
childIds: param.refRowIds, childIds: Array.isArray(param.refRowIds) ? param.refRowIds : [param.refRowIds],
rowId: param.rowId, rowId: param.rowId,
cookie: param.cookie, cookie: param.cookie,
}); });
@ -340,7 +340,7 @@ export class DataTableService {
await baseModel.removeLinks({ await baseModel.removeLinks({
colId: column.id, colId: column.id,
childIds: param.refRowIds, childIds: Array.isArray(param.refRowIds) ? param.refRowIds : [param.refRowIds],
rowId: param.rowId, rowId: param.rowId,
cookie: param.cookie, cookie: param.cookie,
}); });

Loading…
Cancel
Save